## Count elements such that there are exactly X elements with values greater than or equal to X

Given an array arr of N integers, the task is to find the number of elements that satisfy the following condition: If the element is… Read More »

- Binary Search
- Search an element in a sorted and rotated array
- K'th Smallest/Largest Element in Unsorted Array | Set 1
- k largest(or smallest) elements in an array | added Min Heap method
- Find the Missing Number
- Linear Search
- Find next greater number with same set of digits
- K'th Smallest/Largest Element in Unsorted Array | Set 2 (Expected Linear Time)
- Median of two sorted arrays of same size
- K'th Smallest/Largest Element in Unsorted Array | Set 3 (Worst Case Linear Time)
- Given a sorted and rotated array, find if there is a pair with a given sum
- Find the minimum element in a sorted and rotated array
- K'th largest element in a stream
- Find whether an array is subset of another array | Added Method 3
- The painter's partition problem
- Jump Search
- Find all triplets with zero sum
- Find the repeating and the missing | Added 3 new methods
- Two Pointers Technique
- Search in a row wise and column wise sorted matrix
- Given an array of of size n and a number k, find all elements that appear more than n/k times
- Find four elements that sum to a given value | Set 1 (n^3 solution)
- Find a peak element
- Interpolation Search
- Maximum and minimum of an array using minimum number of comparisons
- The painter's partition problem | Set 2
- Median of two sorted arrays with different sizes in O(log(min(n, m)))
- Count number of occurrences (or frequency) in a sorted array
- Find the row with maximum number of 1s
- Sort an array according to the order defined by another array

Given an array arr of N integers, the task is to find the number of elements that satisfy the following condition: If the element is… Read More »

Given an integer ‘K’ and a row-wise sorted 2-D Matrix i.e. the matrix has the following properties: Integers in each row are sorted from left… Read More »

Suppose you a given an array. You have to find the length of the longest subarray such that each and every element of it is… Read More »

Given an array of N integers and a number X, the task is to find the number of segments such that all elements in the… Read More »

Given an array of integers, find the elements from the array whose frequency lies in the range [l, r]. Examples: Input : arr[] = {… Read More »

Given an array of integers, find the k smallest numbers after deleting given elements. In case of repeating elements delete only one instance in the… Read More »

Given an array of integers, remove all the elements which appear strictly less than k times. Examples: Input : arr[] = {1, 2, 2, 3,… Read More »

S is string containing only lowercase English alphabets. We need to find if there exists at least one palindromic sub-string whose length is even. Examples:… Read More »

Given an array of integers, remove all the occurrences of those elements which appear strictly more than k times in the array. Examples: Input :… Read More »

Given an array of integers, find the smallest number after deleting given elements. In case of repeating elements, we delete one instance (from the original… Read More »

Given an array of integers, find the largest number after deleting the given elements. In case of repeating elements, delete one instance for every instance… Read More »

Given two integers and . The task is to find the Nth term which is divisible by either of or . Examples : Input :… Read More »

Given a string, the task is to replace all occurrences of pi with 3.14 in the given string. Examples: Input : str = “2 *… Read More »

Given a strictly increasing array A of positive integers where, . The task is to find the length of the longest Fibonacci-like subsequence of A.… Read More »

Given an array of integers, consider the elements as the height of the building, find the number of buildings that can be seen from the… Read More »