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

# Tag Archives: Binary Search

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

Given a vector of pairs arr[] and Q queries in the form of pairs in an array Queries[], the task for each query is to… Read More

Given an array, arr[] of size N whose elements from left to right, must be read as an incoming stream of integers, the task is… Read More

Given an array arr[] of size N, the task is to find the frequency of each distinct element present in the given array. Examples: Input:… Read More

Given a 2D array arr[][] of the form {start, end} representing the start and end time of N meetings, also given two arrays entrance[] and… Read More

Given an integer N which needs to be present as a value in a node in the last level of a Tree rooted at 1… Read More

Given an array wood[] of size N, representing the length of N pieces of wood and an integer K, at least K pieces of the… Read More

Given two strings str1 and str2 of lengths N and M respectively, the task is to check if str2 can be formed by appending subsequences… Read More