## Create a Sorted Array Using Binary Search

Given an array, the task is to create a new sorted array in ascending order from the elements of the given array. Examples: Input :… Read More »

- Binary Search a String
- Distribute N candies among K people
- Maximum element in a sorted and rotated array
- Number of subarrays have bitwise OR >= K
- Search element in a Spirally sorted Matrix
- Finding Floor and Ceil of a Sorted Array using C++ STL
- Minimum in an array which is first decreasing then increasing
- Count sub-arrays whose product is divisible by k
- Count the triplets such that A[i] < B[j] < C[k]
- Minimum K such that every substring of length atleast K contains a character c
- Find the minimum number of rectangles left after inserting one into another
- Given an array and two integers l and r, find the kth largest element in the range [l, r]
- Find missing element in a sorted array of consecutive numbers
- Divide array into two parts with equal sum according to the given constraints
- Find the number of elements greater than k in a sorted array
- Minimum number N such that total set bits of all numbers from 1 to N is at-least X
- Find the maximum possible value of the minimum value of modified array
- Count numbers < = N whose difference with the count of primes upto them is > = K
- Count numbers in a range having GCD of powers of prime factors equal to 1
- Pick points from array such that minimum distance is maximized
- Find minimum positive integer x such that a(x^2) + b(x) + c >= k
- Find row with maximum and minimum number of zeroes in given Matrix
- Count of integers of the form (2^x * 3^y) in the range [L, R]
- Count of Numbers such that difference between the number and sum of its digits not less than L
- Minimum increments to convert to an array of consecutive integers
- Find the lexicographically smallest sequence which can be formed by re-arranging elements of second array
- Given a string and an integer k, find the kth sub-string when all the sub-strings are sorted according to the given condition
- Maximum volume of cube for every person when edge of N cubes are given
- Find the minimum of maximum length of a jump required to reach the last island in exactly k jumps
- Search an element in given N ranges

Given an array, the task is to create a new sorted array in ascending order from the elements of the given array. Examples: Input :… Read More »

Given a 2D matrix containing only zeroes and ones, where each row is sorted. The task is to find the row with the maximum number… Read More »

Given a string S consisting of character from ‘a’ to ‘z’. The task is to find the length of the largest substring of S which… Read More »

Given an array arr[] with N elements, the task is to find the minimum number of operations required so that an Arithmetic Progression with the… Read More »

Given three array A[], B[] and C[] of N integers each. The task is to find the count of triplets (A[i], B[j], C[k]) such that… Read More »

Given a range [L, R] where 0 ≤ L ≤ R ≤ 108. The task is to find the count of integers from the given… Read More »

Given two arrays A and B of N integers. Reorder the elements of B in itself in such a way that the sequence formed by… Read More »

Given two strings A and B and two integers b and m. The task is to find that if it is possible to form string… Read More »

Given two arrays box[] and truck[] where box[i] represents the weight of the ith box and truck[i] represents the maximum load that the ith truck… Read More »

Given an array arr[] of integers, where the ith integer represents the position where an island is present, and an integer k (1 ≤ k… Read More »

Given width and height of N rectangles. The task is to find the minimum number of rectangles left after inserting one into another. Note :… Read More »

Given N non-overlapping ranges L[] and R[] where the every range starts after the previous range ends i.e. L[i] > R[i – 1] for all… Read More »

Given a string str, its sub-strings are formed in such a way that all the sub-strings starting with the first character of the string will… Read More »

Given four integers a, b, c and k. The task is to find the minimum positive value of x such that ax2 + bx +… Read More »

Given an array arr[] of N integers, the task is to select an integer x (which may or may not be present in the array)… Read More »