Skip to content

Category Archives: Searching

Given a string str and two integers X and Y, the task is to find the maximum cost required to remove all the substrings “pr”… Read More
Given two strings str1 and str2 of size N consisting of only three characters A, B, and C, the task is to check whether the… Read More
Given a Binary Tree and an integer K, the task is to check if the Tree consists of a pair of leaf nodes with sum… Read More
Given an integers N such that there is a chessboard of size N*N and an array pos[][] of K pairs of integers which represent the… Read More
Given a binary string str of length N and an integer K where K is in the range (1 ≤ K ≤ N), the task… Read More
Given an array arr[], the task is to print all possible subarrays having a product of its elements less than or equal to K. Input:… Read More
Given a list arr[] of everyday temperatures. For each day, the task is to find the count of days remaining for the next day with… Read More
Given an array arr[] and an integer K, the task is to print the maximum number of non-overlapping subarrays with a sum equal to K.… Read More
Given a matrix arr[][] of size N * 3 such that each row consists of 3 properties defining an element, i.e. (x-coordinate, y-coordinate, speed), and… Read More
Given an array arr[] of size, N, the task is to find the length of the longest subarray that forms an Arithmetic Progression.Examples: Input: arr[]… Read More
Given three numbers a, b, and c that forms a monotonically increasing function of the form a*x2 + b*x + c and two number A… Read More
Given string str, the task is to minimize the total cost to remove all the characters from the string in alphabetical order. The cost of… Read More
Given a N-ary tree with N vertices rooted at 1 and a set of vertices as V[], the task is to print any such vertex… Read More
Given an array arr[] of size N, the task is to check if the array contains only one distinct element or not. If it contains… Read More
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and… Read More