Given an array arr[] of N integers, the task for each array element is to find the number of ways of choosing a pair of… Read More

# Tag Archives: cpp-map

Given an array of strings arr[] consisting of N strings, the task is to categorize the strings according to the hash value obtained by adding… Read More

Given two strings S1 and S2 of lengths M and N respectively, the task is to calculate the sum of the frequencies of the characters… Read More

Given an array arr[] consisting of N integers, the task is to count the number of valid pairs (i, j) such that arr[i] + arr[j]… Read More

Given an array arr[] of size N, the task is for every non-repeating array element is to find the highest power of 2 that does… Read More

Given a binary tree consisting of either 1 or 0 as its node values, the task is to find the sum of all vertical levels… Read More

Given an array arr[] consisting of N integers, the task is to find the integers whose digits are anagrams of each other and print the… Read More

Given an array arr[] consisting of N intervals of the form of [L, R], where L, R denotes the start and end positions of the… Read More

Given two strings A and B of length N and M respectively and an array arr[] consisting of K integers, the task is to check… Read More

Given two strings A and B, the task is to count the minimum number of operations required to construct the string B by following operations: … Read More

Given an array arr[] consisting of N integers, the task is to minimize the number of operations required to make all array elements equal by… Read More

Given an array arr[] of size N, the task is to count the number of subarrays consisting of a single distinct element that can be… Read More

Given an array arr[] consisting of N integers and an integer K, the task is to find the maximum number of unique elements possible by… Read More

Given an array arr[] of size N, the task is to check if it is possible to split the array arr[] into different subsequences of… Read More