## Number of subarrays such that XOR of one half is equal to the other

Given an array of N numbers, the task is to find the number of sub-arrays (size of the sub-array should be an even number) of… Read More »

## Maximum product from array such that frequency sum of all repeating elements in product is less than or equal to 2 * k

Given an array arr[] and an integer k, the task is to find the maximum product from the array such that the frequency sum of… Read More »

## Longest sub-sequence of array containing Lucas numbers

Given an array arr[] of N elements, the task is to find the length of the longest sub-sequence in arr[] such that all the elements… Read More »

## Print the first shortest root to leaf path in a Binary Tree

Given a Binary Tree with distinct values, the task is to print the first smallest root to leaf path. We basically need to print the… Read More »

## Count of words that are present in all the given sentences

Given n sentences. The task is to count the number of words that appear in all of these sentences. Note that every word consists of… Read More »

## Count of unique pairs (arr[i], arr[j]) such that i < j

Given an array arr[], the task is to print the count of unique pairs (arr[i], arr[j]) such that i < j. Examples: Input: arr[] =… Read More »

## Number of ways to choose an integer such that there are exactly K elements greater than it in the given array

Given an array arr[] of N elements and an integer K, the task is to find the number of ways of choosing an integer X… Read More »

## Check if a number can be represented as a sum of 2 triangular numbers

Given an integer N, the task is to find out whether it can be written as a sum of 2 triangular numbers (which may or… Read More »

## Count occurrences of a string that can be constructed from another given string

Given two strings str1 and str2 where str1 being the parent string. The task is to find out the number of string as str2 that… Read More »

## Number of unique pairs in an array

Given an array of N elements, the task is to find all the unique pairs that can be formed using the elements of a given… Read More »

## Choose atleast two elements from array such that their GCD is 1 and cost is minimum

Given two integer arrays arr[] and cost[] where cost[i] is the cost of choosing arr[i]. The task is to choose a subset with at least… Read More »

## Check if it is possible to reach a number by making jumps of two given length

Given a starting position ‘k’ and two jump sizes ‘d1’ and ‘d2’, our task is to find the minimum number of jumps needed to reach… Read More »

## Find product of sums of data of leaves at same levels | Set 2

Given a Binary Tree, return following value for it. For every level, compute sum of all leaves if there are leaves at this level. Otherwise… Read More »

## Count distinct elements in an array

Given an unsorted array, count all distinct elements in it. Examples: Input : arr[] = {10, 20, 20, 10, 30, 10} Output : 3 There… Read More »

## Weighted sum of the characters of a string in an array | Set 2

You are given an array of strings str[], the task is to find the score of a given string s from the array. The score… Read More »