Skip to content

Tag Archives: cpp-unordered_map

We are given an array consisting of n integers and an integer k. We need to find the minimum range in array [l, r] (both… Read More
Given an array of size n. The task is to find the longest subsequence such that difference between adjacents is one. Time Complexity of O(n)… Read More
A C++ map and unordered_map are initialized to some keys and their respective mapped values. Examples:   Input : Map : 1 -> 4, 2 -> 6,… Read More
We introduced and discussed an implementation in below post. Trie | (Insert and Search) – GeeksforGeeks The implementation used in above post uses an array… Read More
Given two arrays A[] and B[] consisting of n and m elements respectively. Find the minimum number of elements to remove from each array such… Read More
Print the elements of an array in the decreasing frequency if 2 numbers have the same frequency then print the one which came first. Examples: … Read More
Given an array with n positive integers. We need to find the minimum number of operation to make all elements equal. We can perform addition,… Read More
We are given two numbers A and B. We need to calculate the number of digits after decimal. If in case the numbers are irrational… Read More
We can traverse map and unordered_map using following different ways.  Using a range based for loop   map // CPP program to traverse a map… Read More
Given two unsorted arrays, check whether both arrays have the same set of elements or not.  Examples:  Input : A = {2, 5, 6, 8,… Read More
Unordered_map is an associated container that stores elements formed by the combination of key-value and a mapped value. The key value is used to uniquely… Read More
Two strings are given and you have to modify 1st string such that all the common characters of the 2nd strings have to be removed… Read More
Given an array of size n, the goal is to find out the smallest number that is repeated exactly ‘k’ times where k > 0? And Examples: … Read More
Given a string, the task is to count all palindrome substring in a given string. Length of palindrome substring is greater than or equal to… Read More

Start Your Coding Journey Now!