Given a binary tree, find all duplicate subtrees. For each duplicate subtree, we only need to return the root node of any one of them.… Read More
Tag Archives: cpp-unordered_map
Given an array of items, an i-th index element denotes the item id’s, and given a number m, the task is to remove m elements… Read More
Given an array of n numbers. Your task is to read numbers from the array and keep at-most K numbers at the top (According to… Read More
Ram and Shyam want to choose a website to learn programming and they both have a list of favorite websites represented by strings.You need to… Read More
Given a read-only array of size ( n+1 ), find one of the multiple repeating elements in the array where the array contains integers only… Read More
Given an array of n words. Some words are repeated twice, we need to count such words. Examples: Input : s[] = {"hate", "love", "peace",… Read More
Given Postorder and Inorder traversals, construct the tree. Examples: Input: in[] = {2, 1, 3} post[] = {2, 3, 1} Output: Root of below tree… 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
Given two binary arrays, arr1[] and arr2[] of the same size n. Find the length of the longest common span (i, j) where j >=… Read More
Let us consider the below traversals: Inorder sequence: D B E A F C Preorder sequence: A B D E C F Recommended PracticeConstruct Tree… Read More