Given a positive integer N, the task is to find the largest and smallest elements, from the maximum leaf nodes of every possible binary max-heap… Read More

# Category Archives: Data Structures

Given two sentences S1 and S2, the task is to check if the sentences can be made equal by inserting at most one sentence(possibly, empty)… Read More

Given an array arr[] of size N, which contains a permutation of numbers from 1 to M, as well as an element that is repeated(one… Read More

Given an integer array arr[] of size N, the task is to calculate the total number of distinct Greatest Common Divisors(GCDs) among all the non-empty… Read More

Given a string S consisting of N lowercase English characters, the task is to print the lexicographically, the largest string obtained using only the minimum… Read More

Given an array arr[] consisting of N positive integers, the task is to check if it is possible to color the N objects such that… Read More

Given an array arr[ ] of size N, consider an array prefix[ ] where prefix[i] is the sum of the first i elements of arr.… Read More

Given an array, arr[] consisting of N distinct integers and a positive integer K, the task is to find the number of ways to select… Read More

Given a string, S of even length N, the task is to find the minimum number of moves needed to convert the string to a… Read More

Being a programmer, you might have solved a lot of programming challenges. In programming space and time complexity matters a lot when we need to… Read More

Independent set of Graph as a pre-requisite is the set of vertices where no two are adjacent to each other. It is just opposite in… Read More

Given an integer array A[] of size N, the task is to find the prime numbers just less and just greater than A[i] (for all… Read More

Given a doubly-linked list containing N nodes, where each node is at most K away from its target position in the list, the task is… Read More

Given a binary string S of size N, the task is to find the maximum number of operations that can be performed on S, by… Read More