Skip to content

Tag Archives: cpp-map

Given an array arr, the task is to remove minimum number of elements such that after their removal, max(arr) <= 2 * min(arr). Examples: Input:… Read More
A double ended priority queue supports operations of both max heap (a max priority queue) and min heap (a min priority queue). The following operations… Read More
Given two arrays arr1[] and arr2[]. The task is to find the total number of distinct pairs(formed by picking 1 element from arr1 and one… Read More
Given an unsorted array A[]. The task is to print all unique pairs in the unsorted array with equal sum.Note: Print the result in the… Read More
Given an array A[] of integers. The task is to print all indices of this array such that after removing the ith element from the… Read More
Given two strings, the task is to check whether the frequencies of a character(for each character) in one string is a multiple or a factor… Read More
Given an array arr with unique elements, the task is to count the total number of pairs of elements that have equal set bits count.… Read More
Given an array of integers and an integer . For every integer of the array a[i], the task is to calculate the count of numbers… Read More
Given a string with lowercase English alphabets. The task is to check whether the frequency of the characters in the string can be arranged as… Read More
Given two string ‘S1’ and ‘S2’, the task is to return the most frequent (which is used the maximum number of times) word from ‘S1’… Read More
Given a two dimensional matrix A of zero’s and one’s and an integer K. In each move, you can choose any row or column and… Read More
Given a string ‘str’ containing lowercase English alphabets, the task is to find whether the frequencies of the characters of the string are in Lucas… Read More
The map::key_comp() is a function in STL in C++ that returns a copy of comparison object used by container that compare keys. Syntax: map.key_comp() Return… Read More
Given an infinite chessboard with the same rules as that of chess. Also given are N knights coordinates on the infinite chessboard(-10^9 <= x, y… Read More
The std::map::value_comp() is a function in C++ STL. It returns a function object that compares objects of type std::map::value. Syntax: value_compare value_comp() const Parameters: It… Read More