## Number of Positions to partition the string such that atleast m characters with same frequency are present in each substring

Given a string str of lowercase English alphabets and an integer m. The task is to count how many positions are there in the string… Read More »

## Sum of elements in 1st array such that number of elements less than or equal to them in 2nd array is maximum

Given two unsorted arrays arr1[] and arr2[], the task is to find the sum of elements of arr1[] such that number of elements less than… Read More »

## Print 2-D co-ordinate points in ascending order followed by their frequencies

Given two arrays x[] and y[] where x[i] represents the x coordinate and y[i] represents the corresponding y coordinate of a 2-D point, the task… Read More »

## Split the array elements into strictly increasing and decreasing sequence

Given an array of N elements. The task is to split the elements into two arrays say a1[] and a2[] such that one contains strictly… Read More »

## Find number of unique triangles among given N triangles

Given three arrays a[], b[] and c[] of N elements representing the three sides of N triangles. The task is to find the number of… Read More »

## Minimum number of given operations required to convert a permutation into an identity permutation

Given a permutation P (P1, P2, P3, … Pn) of first n natural numbers. Find the minimum number of operations to convert it into an… Read More »

## Count distinct points visited on the number line

Given a person who is at position current_pos and a binary string path which is the moves the person took, if path[i] = ‘0’ then… Read More »

## Count of pairs of strings which differ in exactly one position

Given an array arr[] of strings of equal lengths. The task is to calculate the total number of pairs of strings which differ in exactly… Read More »

## Check if product of array containing prime numbers is a perfect square

Given an array arr[] containing only prime numbers, the task is to check if the product of the array elements is a perfect square or… Read More »

## Number of ways in which the substring in range [L, R] can be formed using characters out of the range

Given a string S and a range [L, R]. The task is to find the number of ways in which the sub-string in the range… Read More »

## Maximum length of a sub-array with ugly numbers

Given an array arr[] of N elements (0 ≤ arr[i] ≤ 1000). The task is to find the maximum length of the sub-array that contains… Read More »

## Sum of nodes in bottom view of Binary Tree

Given a binary tree, the task is to print the sum of nodes in bottom view of the given Binary Tree. Bottom view of a… Read More »

## Find d to maximize the number of zeros in array c[] created as c[i] = d*a[i] + b[i]

Given two arrays of N integers. Consider an array C, where the i-th integer will be d*a[i] + b[i] where d is any arbitrary real… Read More »

## Sum of nodes in top view of binary tree

Top view of a binary tree is the set of nodes visible when the tree is viewed from the top. Given a binary tree, the… Read More »

## Minimum length substring with exactly K distinct characters

Given a string S and a number K. The task is to find the minimum length substring having exactly K distinct characters. Note: The string… Read More »