Skip to content

Category Archives: Algorithms

Given two arrays of strings SearchWord[] and FindWord[]. The task is to check how many strings in FindWord[] can be formed after the following operations… Read More
Given an array B, and two integers N, X (2 ≤ X ≤ 100). Initially, array arr has all its values as zero. The task… Read More
Given an array A[] of size N, find two Sub-sequences a and b, such that the sum of the average of two subsequences is maximized… Read More
Given a binary matrix of size NxN which is initially filled with 0’s and Q queries such that: Each query is of type (r, c)… Read More
Suffix Sum ArrayGiven an array arr[] of size N, the task is to compute and return its suffix sum array.  Suffix Sum is a precomputation… Read More
Given two numbers A and B, the task is to find the minimum number of operations required to reduce either A or B to 0,… Read More
Given integers N and K, the task is to generate an array of length N which contains exactly K subarrays as a permutation of 1… Read More
Who is Love Babbar? Love Babbar is a famous Youtuber, graduated from NSUT Delhi who has also worked as a Software Engineer at Amazon. What… Read More
Given a tree with N nodes and (N-1) edges and source node is at 1st position. There are Q queries, each of the type {pos,… Read More
Over the network, messages are sent as data packets. Each data packet is a series of bytes (8bits = 1 byte). The task is to… Read More
In the COVID times, a movie theatre has to follow a Social distance rule where every two seated individuals must have at least 6 feet… Read More
Given N processes and two arrays, arr1[] and arr2[] of size N each. arr1[] contains time spent by any process in critical section and arr2[]… Read More
Given an array of string arr[] and a string str, the task is to print all the strings in arr[] that occur as a substring… Read More
Given two integers N and K, the task is to form a string of size N using the first K characters of the alphabet following… Read More
Given integers A, B and N. The task is to minimize the cost to set N seconds in a digital clock where time is represented… Read More