## Median Of Running Stream of Numbers – (using Set)

Given that integers are being read from a data stream. Find the median of all the elements read so far starting from the first integer… Read More »

## Largest subset where absolute difference of any two element is a power of 2

Given an array arr[] of distinct elements -109 ≤ ai ≤ 109. The task is to find the largest sub-set from the given array such… Read More »

## Count of strings that become equal to one of the two strings after one removal

Given two strings str1 and str2, the task is to count all the valid strings. An example of a valid string is given below: If… Read More »

## Printing pre and post visited times in DFS of a graph

Depth First Search (DFS) marks all the vertices of a graph as visited. So for making DFS useful, some additional information can also be stored.… Read More »

## Maximum of all Subarrays of size k using set in C++ STL

Given an array of size N and an integer K, the task is to find the maximum for each and every contiguous sub-array of size… Read More »

## Find the Initial Array from given array after range sum queries

Given an array arr[] which is the resultant array when a number of queries are performed on the original array. The queries are of the… Read More »

## Check if a number can be expressed as sum two abundant numbers

Given a number N. The task is to express N as sum two Abundant Numbers. If it is not possible print -1. Examples: Input :… Read More »

## Find the sum of the all amicable numbers up to N

Given a number N. FInd the sum of he all amicable numbers up to N. If A and B are Amicable pairs (Two numbers are… Read More »

## Largest sub-set possible for an array satisfying the given condition

Given an array arr[] and an integer K. The task is to find the size of the maximum sub-set such that every pair from the… Read More »

## Minimum multiplications with {2, 3, 7} to make two numbers equal

Given two numbers A and B, the task is to find the minimum number of operations required to make A and B equal. In each… Read More »

## Possible cuts of a number such that maximum parts are divisible by 3

Given a Large number N ( number of digits in N can be up to 105). The task is to find the cuts required of… Read More »

## Count distinct substrings that contain some characters at most k times

Given a integer k and a sting str, the task is to count the number of distinct sub-strings such that each sub-string does not contain… Read More »

## Minimum number of sets with numbers less than Y

Given a string of consecutive digits and a number Y, the task is to find the number of minimum sets such that every set follows… Read More »

## Find the non decreasing order array from given array

Given an array A[] of size N / 2, the task is to construct the array B[] of size N such that: B[] is sorted… Read More »

## Count pairs of parentheses sequences such that parentheses are balanced

Given N bracket sequences, the task is to find the number of pairs of bracket sequences by joining which can be obtained a balanced bracket… Read More »