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

# Tag Archives: cpp-map

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

Given a positive integer N, the task is to check whether N can be represented as the difference between two positive perfect cubes or not.… Read More

Given a string keyboardLayout of size 26 representing the sequence of characters present in a single row of a keyboard and a string word, the… Read More

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

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