CONCEPTS USED: Binary Search DIFFICULTY LEVEL: Hard PROBLEM STATEMENT(SIMPLIFIED): Given an array A containing N elements, construct a new array countSmaller[] such that countSmaller[i] contains count of smaller elements on...
Concepts Used : Heap Difficulty Level : Easy Problem Statement : Given an array containing N integers, our task is to: Create min-heap with 1 based indexing. Remove the element...
Concepts Used: Heap Difficulty Level: Hard Problem Statement : Given a string str, find first K non-repeating characters in lexicographical order, if all the characters are repeating then print "Not...
Concepts Used: Heap Difficulty Level: Easy Problem Statement : Given an array containing N integers, our task is to create a min-heap using the elements of the given array and...
Concepts Used Heap Difficulty Level: Hard Problem Statement : Given N sectors and two integers P and Q, our task is to find Q closest sectors to P sector. Solution...
In the realm of data structures, heaps stand out as an essential tool for efficient manipulation of priority-based information. One common problem encountered when dealing with heaps is finding the...
Concepts Used Heap Difficulty Level Easy Problem Statement : Given an array arr[ ] and a number K where K is smaller than the size of the array, the task...
Concepts Used Heap Difficulty Level Medium Problem Statement : Given a string str and an integer q. We have to generate a string S such that it is lexicographically smallest...
Concepts Used Heap Difficulty Level Medium Problem Statement : We are given N book costs, and k amount of money. We need to find the maximum number of books we...
Concepts Used Heap Difficulty Level Easy Problem Statement : Given N integers where a[i] represent that a[i]th student has won the ith competition. Print top Q students who have won...
Concepts Used Sorting Difficulty Level Hard Problem Statement (Simplified): For given two arrays, print the score of First Array and Second Array such that their difference is maximum. Scoring can...
Concepts Used Sorting Difficulty Level Medium Problem Statement (Simplified): Print the total number of cases in which the current array sequence becomes Arithmetic Progression by adding a number at any...
Concepts Used Sorting Difficulty Level Medium Problem Statement (Simplified): We need to find the total number of steps need to make the current array of size N same as an...
Concepts Used BFS , Recursion Difficulty Level Easy Problem Statement : Given a binary tree, and a node X, we have to sum all the nodes except the node X....
Concepts Used Segment Trees Difficulty Level Easy Problem Statement : Given an array of N elements and Q queries. In each query he is given two values l,r. We have...
Concepts Used Segment Trees, GCD Difficulty Level Medium Problem Statement : Given an array of N elements and Q queries. In each query, two values is given l and r....
Concepts Used Segment Trees Difficulty Level Hard Problem Statement : Given an array of N unique elements and Q queries. In each query, we are given two values l,r. We...
Concepts Used Trie Difficulty Level Medium Problem Statement : Given array of N numbers, we need to find the maximum xor between any pair of the numbers. Solution Approach :...
Concepts Used Trie Difficulty Level Easy Problem Statement : Given a blank dictionary. Now in the first set of operations, you have to insert N integers in the dictionary. And...
Concepts Used Back Tracking Difficulty Level Hard Problem Statement : Given a set of n integers, divide the set in two subsets of n/2 sizes each such that the difference...
Concepts Used Back Tracking Difficulty Level Medium Problem Statement : Given N integers print all the distinct power sets of the sequence in lexicographical order. Solution Approach : Introduction :...
Concepts Used Back Tracking Difficulty Level Easy Problem Statement : Given a string, we have to find total number of different sequences that can be formed using the letters in...
Concepts Used Backtracking Difficulty Level Easy Problem Statement : Given a string containing numeric digits from 2 to 9 inclusive, return all possible letter combinations that the number could represent...
Concepts Used Back Tracking Difficulty Level Hard Problem Statement : Given N integers print all distinct combinations. Solution Approach : Introduction : Idea is to swap all the values one-by-one...
Concepts Used Back Tracking Difficulty Level Hard Problem Statement : Given a non-negative integer n representing the total number of bits , we need to print the sequence of gray...
Concepts Used Back Tracking Difficulty Level Easy Problem Statement : Given n set bits, we have to determine all the time that can be represented by those number of set...
Concepts Used Back Tracking Difficulty Level Hard Problem Statement : Given a matrix of characters with n rows and m columns, and few words. We have to find out if...
Concepts Used Back Tracking Difficulty Level Medium Problem Statement : Given N integers print all possible combinations. Solution Approach : Introduction : Idea is to swap all the values one-by-one...
Concepts Used Back Tracking Difficulty Level Medium Problem Statement : Given N, count all the numbers with unique digits less than 10n. Solution Approach : Introduction : Idea is to...