## Largest gap in an array

Given an unsorted array of length N and we have to find largest gap between any two elements of array.In simple words, find max(|Ai-Aj|) where… Read More »

Given an unsorted array of length N and we have to find largest gap between any two elements of array.In simple words, find max(|Ai-Aj|) where… Read More »

Given an integer array, find a maximum product of a quadruple in the array. Examples: Input: [10, 3, 5, 6, 20] Output: 6000 Multiplication of… Read More »

Given an array of non negative integers and a number x, find a pair in array whose product is closest to x. Examples: Input :… Read More »

Given a array of n positive elements we need to find the lowest possible sum of max and min elements in a subarray given that… Read More »

Given a 2D array of size M x N. Calculate count of positions in 2D array where address as per row major order equals to… Read More »

Given a set of n distinct points x1, x2, x3… xn all lying on the X-axis and an integer L, the task is to find… Read More »

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 »