## N/3 repeated number in an array with O(1) space

We are given a read only array of n integers. Find any element that appears more than n/3 times in the array in linear time… Read More »

- Find the smallest positive number missing from an unsorted array | Set 2
- Find the Missing Number in a sorted array
- Next Smaller Element
- Longest subarray having average greater than or equal to x
- Print all pairs with given sum
- Remove all occurrences of a character in a string
- Number of elements that can be seen from right side
- Largest subarray having sum greater than k
- Find the index of an array element in Java
- Duplicates in an array in O(n) time and by using O(1) extra space | Set-3
- Longest subarray with elements having equal modulo K
- Find the only missing number in a sorted array
- Find array elements with frequencies in range [l , r]
- Length of largest sub-array having primes strictly greater than non-primes
- KLA Tencor Interview Experience | Set 3
- Smallest Pair Sum in an array
- Queries to check whether a given digit is present in the given Range
- Floor in Binary Search Tree (BST)
- Count characters with same neighbors
- Sudo Placement | Placement Tour
- Variants of Binary Search
- Number of anomalies in an array
- OYO Rooms Interview Experience (On-Campus)
- Check if a string contains a palindromic sub-string of even length
- Program to find Nth term divisible by a or b
- Longest Subarray with first element greater than or equal to Last element
- Find the slope of the given number
- Check if array can be sorted with one swap
- Queries to check if a number lies in N ranges of L-R
- Count Triplets such that one of the numbers can be written as sum of the other two

We are given a read only array of n integers. Find any element that appears more than n/3 times in the array in linear time… Read More »

Given an array, find the maximum difference between its two consecutive elements in its sorted form. Examples: Input : arr[] = {1, 10, 5} Output… Read More »

Given an array A[] of n elements and an integer k. The task is to find the number of triplet (x, y, k), where 0… Read More »

Given two strings s1 and s2, check if s1 is a suffix of s2. Or in simple words we need to find whether string s2… Read More »

Given a string s, print reverse of string and remove the characters from the reversed string where there are vowels in the original string. Examples:… Read More »

Given two arrays among which one is almost sorted with one element being in the wrong position making the array unsorted, the task is to… Read More »

Given an array whose elements represents the coefficients of a polynomial of degree n, if the polynomial has a degree n then the array will… Read More »

How to apply STL binary_search to vector of pairs(key, value), given that vector is sorted by its first value(key) struct compare in the code contains… Read More »

Given an array of positive distinct integers. We need to find the only element whose replacement with any other value makes array elements distinct consecutive.… Read More »

You are given an array of size ‘n’. You have to replace every pair of consecutive values ‘x’ by a single value ‘x+1’ every time… Read More »

Given a string s we have to find the length of the longest substring of s which contain exactly K distinct vowels. Examples: Input :… Read More »

Given an array arr[]. Find maximum value of prefix sum which is also suffix sum for index i in arr[]. Examples : Input : arr[]… Read More »

Given an array of even number of elements, form groups of 2 using these array elements such that the difference between the group with highest… Read More »

Given an array and a value k. We have to find the maximum number of equal elements possible for the array so that we can… Read More »

Parenthesis are said to be balanced when every opening brace has a closing brace like “()()” or “(())” or “(()())” etc. Incorrect balancing includes “)(”… Read More »