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

# Tag Archives: cpp-map

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

Given two arrays firstArr[], consisting of distinct elements only, and secondArr[], the task is to find the length of LCS between these 2 arrays. Examples:… Read More

Given an array arr[] of size N consisting of only 0s, 1s and 2s, the task is to find the count of triplets of indices… Read More

Given a Binary Tree, the task is to find the most frequent subtree sum that can be obtained by considering every node of the given… Read More

Given an array arr[] of size N, the task for every array element arr[i], is to count the number of pairs of equal elements that… Read More

Maps are associative containers that store elements in a specific order. It stores elements in a combination of key values and mapped values. Syntax: map<data… Read More

Given an array arr[] of size N and an integer K, the task is to find all the array elements that appear more than (N… Read More