Given a pile of n pairs of elements in array arr[], containing 2*n elements, we have to print with the following conditions follow: If pair… Read More
Tag Archives: cpp-unordered_map
Given an array arr[] of N integers, the task is to find the length of the longest subarray where the sum of the elements in… Read More
Given two positive integers, check if it is possible to rearrange the digits of each integer, such that after rearranging, the concatenation of two integers… Read More
In this article, we are given an array that may contain duplicate values. We will print all elements and their frequencies if the duplicates exist.… Read More
Given an array A[] of size N, the task is to maximize the frequency of any element by adding any positive integer X to all… Read More
Given two arrays arr1[] and arr2[] of length N and M respectively, the task is to check if the two arrays are equal or not. … Read More
Given two snapshots S1 and S2 of N elements, the task is to find the elements which are changing their groups and the ones that… Read More
Given an array arr[] of size N and three integers X, Y and K, the task is to count the number of pairs (i, j)… Read More
Given a 3D array of size N*M*P consisting only of English alphabet characters, the task is to print the frequency of all the elements in… Read More
unordered_map is an associated container available in the C++ Standard Template Library(STL) that is used to store key-value pairs. It internally uses the working principle… Read More
Given an integer array arr[] and a positive integer K, the task is to count all distinct pairs with differences equal to K. Examples: Input:… Read More
Given an array A[] having N positive integers, the task is to perform the following operations and maximize the sum obtained while reducing the array:… Read More
Given an array arr[] containing positive integers, count the total number of pairs for which arr[i]+i = arr[j]+j such that 0≤i<j≤n-1. Examples: Input: arr[] =… Read More
Given an array arr[] of N integers and an array query[] having Q integers, the task is to print the array arr[] after moving the… Read More
What is an array? An array in any programming language is a data structure that is used to store elements or data items of similar… Read More