Given two arrays A[] and B[] consisting of N integers and an integer K, the task is to find the maximum value of B[i] +… Read More

# Tag Archives: Binary Search

Given a sorted array arr[] of size N (1 ≤ N ≤ 105) and two integers A and B, the task is to calculate the… Read More

Given an array arr[] of size N and an array Q[] consisting of M integers, each representing a query, the task for each query Q[i]… Read More

Given a mountain array arr[] and an integer X, the task is to find the smallest index of X in the given array. If no… Read More

Given an array arr[] of size N, the task is to find the minimum count of array elements found by applying the Randomized Binary Search… Read More

Given two positive integers N and X, the task is to find the smallest divisor of N which is closest to X. Examples: Input: N… Read More

Given two arrays firstArr[], consisting of distinct elements only, and secondArr[], the task is to find the length of LCS between these 2 arrays. Examples:… Read More

Given an integer N, the task is to find two integers with minimum possible sum such that their product is strictly greater than N. Examples:… Read More

Given an array arr[] of size N and an integer K, the task is to find the length of the longest subarray consisting of same… Read More

Queries to find the length of the longest prefix from given array having all elements divisible by K

Given an array arr[] consisting of N elements and an arrayQ[], the task for each query is to find the length of the longest prefix… Read More

Given an array arr[] consiting of N integers representing the number of coins in each pile, and an integer H, the task is to find… Read More

Given an array arr[] of size N and a positive integer K, the task is to find the smallest positive integer such that the sum… Read More

Given an array arr[] of size N and an integer K, the task is to find all the array elements that appear more than (N… Read More

Given two arrays A[], consisting of N integers, and B[], consisting of taste values of M chocolates and an integer X, the task is to… Read More