## Find the number of p-sided squares in a grid with K blacks painted

Given a grid of size H*W with all cells initially white. Given N pairs (i, j) in an array, for each pair, paint cell (i,… Read More »

- Find sub-arrays from given two arrays such that they have equal sum
- Find whether an array is subset of another array using Map
- Print elements of an array according to the order defined by another array | set 2
- Minimum Bitwise XOR operations to make any two array elements equal
- Find number of unique triangles among given N triangles
- Count of quadruplets with given Sum | Set 2
- Find the number of p-sided squares in a grid with K blacks painted
- Check if frequency of characters are in Recaman Series

Given a grid of size H*W with all cells initially white. Given N pairs (i, j) in an array, for each pair, paint cell (i,… Read More »

Given an array arr[] of integers of size N and an integer K. One can perform the Bitwise XOR operation between any array element and… Read More »

Given two arrays a1[] and a2[], print elements of a1 in such a way that the relative order among the elements will be the same… Read More »

Given two arrays: arr1[0..m-1] and arr2[0..n-1]. Find whether arr2[] is a subset of arr1[] or not. Both the arrays are not in sorted order. It… Read More »

Given two arrays A[] and B[] of equal sizes i.e. N containing integers from 1 to N. The task is to find sub-arrays from the… Read More »

Given four arrays containing integer elements and an integer sum, the task is to count the quadruplets such that each element is chosen from a… Read More »

Given three arrays a[], b[] and c[] of N elements representing the three sides of N triangles. The task is to find the number of… Read More »

Given a string of lowercase alphabets. The task is to check whether the frequency of alphabets in this string, after arranging in any possible manner,… Read More »

Given two integer arrays arr[] and cost[] where cost[i] is the cost of choosing arr[i]. The task is to choose a subset with at least… Read More »

map::get_allocator() is a built in function in C++ STL which is used to get allocator of container map. Syntax: Allocator_type get_allocator() Parameters: This function does… Read More »

Given an array of N positive elements find the number of quadruple, (i, j, k, m) such that i < j < k < m… Read More »

If we wish to delete the last element from a map, we can use following methods : using prev(mp.end()) : what prev function do is,… Read More »

Map stores the elements in sorted order of keys. Now if we want to traverse it in reverse order we will use reverse_iterator of map.… Read More »

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 »