This blog Discusses the famous question “list reduction in linked list”. Linked list reduction plays an important role in improving your data structures like linked list. In linked list reduction,...
CONCEPTS USED: Basic Pointer Manipulation DIFFICULTY LEVEL: Medium PROBLEM STATEMENT(SIMPLIFIED): Given a linked list of N nodes such that the list is sorted in two parts, the first part and...
CONCEPTS USED: Basic Pointer Manipulation DIFFICULTY LEVEL: Medium PROBLEM STATEMENT(SIMPLIFIED): Given a linked list of N elements and a value X, your task is to arrange the list in such...
CONCEPTS USED: Basic Manipulation DIFFICULTY LEVEL: Easy PROBLEM STATEMENT(SIMPLIFIED): Given a linked list of N nodes, each node containing binary bit either 0 or 1 as a character. Your task...
Concepts Used Depth First Search, Disjoint Set Difficulty Level Medium Problem Statement : Given a 2D matrix, which contains only two numbers 0 or 1. In the map group of...
Concepts Used Breadth First Search Difficulty Level Easy Problem Statement : Given locations of X & Y islands, we need to find the minimum distance between a given pair of...
Concepts Used Breadth First Search Difficulty Level Hard Problem Statement : Given a graph we have to find the length of the shortest cycle in the given graph. If no...
Concepts Used Sorting Difficulty Level Medium Problem Statement (Simplified): Find the maximum possible median of provided odd-sized array where you can increase any element by one where each increment is...
Concepts Used Sorting Difficulty Level Easy Problem Statement (Simplified): Print the last number left in the array after deleting the largest number in the array then the smallest number repeatedly....
Concepts Used Depth First Search, Graph Difficulty Level Medium Problem Statement : Check whether the graph is a tree or not. See original problem statement here Solution Approach : Introduction...
Concepts Used Depth First Search, Disjoint Set Difficulty Level Medium Problem Statement : There are two clans numbered sequentially from 1 to N and given two integers, u and v...
Concepts Used Depth First Search, Disjoint Set Difficulty Level Easy Problem Statement : Given an undirected graph, print Yes if a cycle is present in the graph else print No....
Concepts Used: Stack. Difficulty Level: Medium. Problem Statement : Arnab is hosting a party but he has only k seats. Guest have come at different times and leave at different...
Concepts Used: DP/recursion and Stack. Difficulty Level: Hard. Problem Statement : Given a 2D binary matrix filled with 0’s and 1’s, find the largest rectangle containing all ones and print...
Concepts Used: Stack. Difficulty Level: Easy. Problem Statement : Make the minimum number without repetition of the digits such that it follows the sequence given in the string. 'I' represents...
Concepts Used Breadth First Search, Disjoint Set Difficulty Level Easy Problem Statement : Given an undirected graph, print Yes if a cycle is present in the graph else print No....
Concepts Used Breadth First Search Difficulty Level Hard Problem Statement : Given a string , we are standing at the starting point and we have to reach end in minimum...
Concepts Used: Stacks. Difficulty Level: Medium. Problem Statement : Arnab is standing in a queue and he is irritated by the tall man standing after him, as he is obstructing...
Concepts Used Breadth First Search Difficulty Level Medium Problem Statement : Given an unweighted, undirected tree print the length of the longest path See original problem statement here Solution Approach...
Concepts Used Depth First Search, Disjoint Set Difficulty Level Medium Problem Statement : Given N number of vertices, M number of edges and relation between them to form an undirected...
Concepts Used: Stacks Difficulty Level: Easy. Problem Statement : Given a stack of integers, sort it in ascending order using another temporary stack. See original problem statement here Solving Approach:...
Concepts Used Stack Difficulty Level Easy Problem Statement : Given a string str of lowercase letters, a duplicate removal consists of choosing two adjacent and equal letters, and removing them....
Get minimum element from stack is a common problem in computer science. A stack is a data structure that follows the Last-In-First-Out (LIFO) principle, where elements are added and removed...
Concepts Used: Stack. Difficulty Level: Hard. Problem Statement : Nishant wants to buy a plot of land, which faces the beach. He will buy only a rectangular plot. So he...
Concepts Used Mathematics Difficulty Level Hard Problem Statement (Simplified): Calculate the sum for a given number n: See original problem statement here Solving Approach : Bruteforce Approach: 1) We can...
Concepts Used: Stack Difficulty Level: Medium. Problem Statement : Find the minimum number of replacements required to make the given string of braces balanced. See original problem statement here Example:...
Concepts Used Heap Difficulty Level Hard Problem Statement : Given an array of N integers, we want to know whether it is possible to divide the students into contiguous groups...
Concepts Used Heap Difficulty Level Medium Problem Statement : Given an array A of size N, we have to perform following operations, untill only one integer remains (N-1 times) :...
Concepts Used Heap Difficulty Level Medium Problem Statement : We are given N elements with an integer S. We want to find such a sub-array that has the maximum possible...
Concepts Used: Queues. Difficulty Level: Medium. Problem Statement : Given a number N, print all possible binary numbers with decimal values from 1 to N, but the catch is you...