Skip to content

Tag Archives: cpp-unordered_map

Given a binary tree, perform postorder traversal.  Recommended: Please try your approach on {IDE} first, before moving on to the solution. Prerequisite - Inorder/preorder/postorder traversal… Read More
Given a linked list, find its first non-repeating integer element. Examples: Input : 10->20->30->10->20->40->30->NULL Output :First Non-repeating element is 40. Input :1->1->2->2->3->4->3->4->5->NULL Output :First Non-repeating… Read More
Given an array A of n elements. We need to change the array into a permutation of numbers from 1 to n using minimum replacements… Read More
Given an array of n string containing lowercase letters. Find the size of largest subset of string which are anagram of each others. An anagram… Read More
Given a decimal number n without floating-point. The problem is to convert the decimal number to octal number with minimum use of arithmetic operators.  Examples: … Read More
Given an array arr[] containing n integers. The problem is to find the length of the longest strict bitonic subsequence. A subsequence is called strict… Read More
Given two same-sized arrays A[] and B[] (both arrays contain distinct elements individually but may have some common elements), the task is to form a… Read More
Pre-requisite : std::map, std::unordered_mapWhen it comes to efficiency, there is a huge difference between maps and unordered maps. We must know the internal working of both… Read More
Given an array that might contain duplicates, find the element whose last appearance is latest. Examples:  Input : arr[] = {10, 30, 20, 10, 20}… Read More
Given an array of N integers and an integer K, pick two distinct elements whose sum is K and find the maximum shortest distance of… Read More
There is a given binary matrix, we need to find if there exists any rectangle or square in the given matrix whose all four corners… Read More
Given two arrays A[] and B[] of size n. It is given that both array individually contains distinct elements. We need to find the sum… Read More
Given an array and an integer K. We need to find the maximum of every segment of length K which has no duplicates in that… Read More
Given an array of n positive integers. We need to find the largest increasing sequence of consecutive positive integers. Examples:  Input : arr[] = {5,… Read More
Given a Binary Tree, find count of distinct nodes in all the root to leaf paths and print the maximum.  Examples: Input : 1 /… Read More

Start Your Coding Journey Now!