## 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 »

## Print all the sum pairs which occur maximum number of times

Given an array arr[] of N distinct integers. The task is to find the sum of two array integers a[i] + a[j] which occurs maximum… Read More »

## Number of quadruples where the first three terms are in AP and last three terms are in GP

Given an array arr[] of N integers. The task is to find the number of index quadruples (i, j, k, l) such that a[i], a[j]… Read More »

## Count all elements in the array which appears at least K times after their first occurrence

Given an array arr[] of N integer elements and an integer K. The task is to count all distinct arr[i] such that arr[i] appears at… Read More »

## Two equal sum segment range queries

Given an array arr[] consisting of N positive integers, and some queries consisting of a range [L, R], the task is to find whether the… Read More »

## Minimum changes required to make a Catalan Sequence

Given an array arr[] of N integer elements, the task is to change the minimum number of elements of this array such that it contains… Read More »

## Count pairs (p, q) such that p occurs in array at least q times and q occurs at least p times

Given an array arr[], the task is to count unordered pairs of positive integers (p, q) such that p occurs in the array at least… Read More »

## k-th missing element in an unsorted array

Given an unsorted sequence a[], the task is to find the K-th missing contiguous element in the increasing sequence of the array elements i.e. consider… Read More »