Given an array arr[] of N integers, and an array Q[] of M pairs, where a pair represents a query of the form {L, R},… Read More

# Tag Archives: cpp-map

There are some data structures that are supported by g++ compiler and are not a part of the C++ standard library. One of these is:… Read More

Max count of N using digits of M such that 2 and 5, and, 6 and 9 can be treated as same respectively

Given an integer N, and the string integer M, the task is to find the total count to make N by using the digits of… Read More

Given two arrays, A[] and B[] consisting of M pairs, representing the edges of the two binary trees of N distinct nodes according to the… Read More

Given an array, arr[] consisting of N strings where each character of the string is lower case English alphabet, the task is to store and… Read More

Given an array arr[] of N integers, the task is to find the maximum prefix length of the array such that removing exactly one element… Read More

Given an array A[] of size N, the task is to find the maximum sum of a subsequence such that for each pair present in… Read More

Generating Random Unweighted Binary Tree: Since this is a tree, the test data generation plan is such that no cycle gets formed. The number of… Read More

Given an array arr[] consisting of N integers, the task is to find the number of pairs such that the GCD of any pair of… Read More

Given an array, arr[] consisting of N integers, the task for each array element arr[i] is to print the sum of |i – j| for… Read More

Given an array weight[] consisting of weights of N items and a positive integer C representing the capacity of each bin, the task is to… Read More

Given an integer N, the task is to check whether the given number is a pangram or not. Note: A Pangram Number contains every digit [0-… Read More

Given a string S representing a sequence of moves(L, R, U, and D) and an integer R representing the radius of a circle whose center… Read More

Given an integer N and two arrays A[][], representing the set of languages a person knows, and B[][], consisting of M pairs of friendships, the… Read More