## Number of GP (Geometric Progression) subsequences of size 3

Given n elements and a ratio r, find the number of G.P. subsequences with length 3. A subsequence is considered GP with length 3 with… Read More »

Given n elements and a ratio r, find the number of G.P. subsequences with length 3. A subsequence is considered GP with length 3 with… Read More »

Given a 26 letter character set, which is equivalent to character set of English alphabet i.e. (abcd….xyz) and act as a relation. We are also… Read More »

Given a string s and two other strings begin and end, find the number of different substrings in the string which begin and end with… Read More »

Given an array that might contain duplicates, find the element whose last appearance is latest. Examples: Input : arr[] = {10, 30, 20, 10, 20}… Read More »

Given an array of N integers and an integer K, pick two distinct elements whose sum is K and find the maximum shortest distance of… Read More »

Find the length of maximum number of consecutive numbers jumbled up in an array. Examples: Input : arr[] = {1, 94, 93, 1000, 5, 92,… Read More »

Sorting using trivial hash function. Examples: Input : 9 4 3 5 8 Output : 3 4 5 8 9 We have read about various… Read More »

There is a given binary matrix, we need to find if there exists any rectangle or square in the given matrix whose all four corners… Read More »

Given two arrays A[] and B[] of size n. It is given that both array individually contain distinct elements. We need to find sum of… Read More »

Given N sweets which can be of many different types and k customers, one customer won’t take the same type of sweet more than 2… Read More »

Given an array and an integer K. We need to find the maximum of every segment of length K which has no duplicates in that… Read More »

Given an array of n positive integers. We need to find the largest increasing sequence of consecutive positive integers. Examples: Input : arr[] = {5,… Read More »

Given a Binary Tree, find count of distinct nodes in a root to leaf path with maximum distinct nodes. Examples: Input : 1 / \… Read More »

Given an array of N integers. In the given, for each positive element ‘x’ there exist a negative value ‘-x’, except one integer whose negative… Read More »

Given N elements and a number K, find the longest subarray which has not more then K distinct elements.(It can have less then K) Examples:… Read More »