## Count pairs from two arrays having sum equal to K

Given an integer K and two arrays A1 and A2, the task is to return the total number of pairs (one element from A1 and… Read More »

- Binary Search
- Search an element in a sorted and rotated array
- K'th Smallest/Largest Element in Unsorted Array | Set 1
- Find the Missing Number
- k largest(or smallest) elements in an array | added Min Heap method
- 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
- Jump Search
- Find all triplets with zero sum
- Find the repeating and the missing | Added 3 new methods
- The painter's partition problem
- 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
- Interpolation Search
- Find four elements that sum to a given value | Set 1 (n^3 solution)
- Find a peak element
- Maximum and minimum of an array using minimum number of comparisons
- Count number of occurrences (or frequency) in a sorted array
- The painter's partition problem | Set 2
- Find the row with maximum number of 1s
- Median of two sorted arrays with different sizes in O(log(min(n, m)))
- Sort an array according to the order defined by another array

Given an integer K and two arrays A1 and A2, the task is to return the total number of pairs (one element from A1 and… Read More »

Given an array A[]. The task is to determine if it is possible to choose two indices ‘i’ and ‘j’ such that the below conditions… Read More »

Given an array A[] of integers. The task is to find the total number of ordered pairs of positive integers (X, Y) such that X… Read More »

Given an integer K and an array arr of integer elements, the task is to print the length of the longest sub-array such that each… Read More »

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 »