Skip to content

Tag Archives: Binary Search

Geek is playing a video game that contains N monsters having varying power denoted by power[i]. Geek will play total Q rounds and for each… Read More
Given an array arr[] of length N and a positive integer k, the task is to find the minimum length of the subarray that needs… Read More
Given an array arr[] of size N, the task is to check if can you change the MEX of the array to MEX + 1… Read More
Given integer H and array A[] of size N. A[] is a sorted array representing the start of the operation, start subtracting 1 from H… Read More
Given two integers X and Y, the task is to find the number of different arrays that can be constructed of size largest possible size… Read More
Given that cake consists of N chunks, whose individual sweetness is represented by the sweetness[] array, the task is to cut the cake into K… Read More
Given an array arr[] of n integers in sorted order, find the maximum number of largest elements that can be selected from the array such… Read More
Given an integer N. The task is to find minimum K such that the factorial of K is multiple of N. (2 ≤ N ≤… Read More
A game involving n players in a circular field with n hiding spots. The ith player starts from the hiding spot given by the expression… Read More
Given an array A[] of N integers and two integers X and Y (X ≤ Y), the task is to find the maximum possible value… Read More
Given two strings S and T of equal length consisting of lowercase characters. In one operation, it is allowed to erase the 0th character of… Read More
Given a sorted array arr[] of size N, an integer X, and a positive integer K, the task is to find the index of Kth… Read More
Given an array A[] of size N along with W, K. We can increase W continuous elements by 1 where we are allowed to perform… Read More
Given an array arr[] of size N and with integers M, K. You are allowed to perform an operation where you can increase the value… Read More
Given a tree with only one node. We want a tree with exactly n-leaf nodes. We have exactly k trees consisting of 1, 2, …,… Read More