## Class template with multiple parameters

Prerequisite: Templates in C++ While creating templates, it is possible to specify more than one type. We can use more than one generic data type… Read More »

## getline (string) in C++

The C++ getline() is a standard library function that is used to read a string or a line from an input stream. It is a… Read More »

## Pseudo Random Number Generator (PRNG)

Pseudo Random Number Generator(PRNG) refers to an algorithm that uses mathematical formulas to produce sequences of random numbers. PRNGs generate a sequence of numbers approximating… Read More »

## Find maximum possible stolen value from houses

There are n houses build in a line, each of which contains some value in it. A thief is going to steal the maximal value… Read More »

## Number of n-digits non-decreasing integers

Given an integer n > 0, which denotes the number of digits, the task to find total number of n-digit positive integers which are non-decreasing… Read More »

## Puzzle | 10 identical bottles of pills

Problem: Given 10 identical bottles of identical pills (each bottle contain hundred of pills). Out of 10 bottles 9 have 1 gram of pills but… Read More »

## Find k numbers with most occurrences in the given array

Given an array of n numbers and a positive integer k. The problem is to find k numbers with most occurrences, i.e., the top k… Read More »

## Print the given pattern recursively

Given a positive integer n. Print the inverted triangular pattern (as described in the examples below) using the recursive approach. Examples: Input : n =… Read More »

## Matrix Multiplication | Recursive

Given two matrices A and B. The task is to multiply matrix A and matrix B recursively. If matrix A and matrix B are not… Read More »

## Rectangular (or Pronic) Numbers

The numbers that can be arranged to form a rectangle are called Rectangular Numbers (also known as Pronic numbers). The first few rectangular numbers are:… Read More »

## Extract maximum numeric value from a given string | Set 1 (General approach)

Given an alphanumeric string, extract maximum numeric value from that string. Alphabets will only be in lower case. One approach to solve the problem is… Read More »

## 2D Transformation | Rotation of objects

We have to rotate an object by a given angle about a given pivot point and print the new co-ordinates. Examples: Input : {(100, 100),… Read More »

## Program for Muller Method

Given a function f(x) on floating number x and three initial distinct guesses for root of the function, find the root of function. Here, f(x)… Read More »

## To check divisibility of any large number by 999

You are given an n-digit large number, you have to check whether it is divisible by 999 without dividing or finding modulo of number by… Read More »

## Write your own len() in Python

The method len() returns the number of elements in the list or length of the string depending upon the argument you are passing. How to… Read More »