## Find a local minima in an array

Given an array arr[0 .. n-1] of distinct integers, the task is to find a local minima in it. We say that an element arr[x]… Read More »

- Optimal Strategy for a Game | Set 2
- Sliding Window Maximum (Maximum of all subarrays of size k) using stack in O(n) time
- Count pairs in array whose sum is divisible by K
- Find k closest numbers in an unsorted array
- Building Heap from Array
- Amazon Internship Interview Experience
- Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2
- Maximum sum such that no two elements are adjacent | Set 2
- Longest subsequence such that adjacent elements have at least one common digit
- Sort an array without changing position of negative numbers
- Create linked list from a given array
- Maximum element in a sorted and rotated array
- Given two arrays count all pairs whose sum is an odd number
- Find maximum xor of k elements in an array
- Partition an array of non-negative integers into two subsets such that average of both the subsets is equal
- Maximum absolute difference in an array
- Find the longest string that can be made up of other strings from the array
- Program to check if an Array is Palindrome or not
- Find minimum difference between any two elements | Set 2
- Remove minimum elements from either side such that 2*min becomes more than max | Set 2
- Kth smallest element in a subarray
- Count the triplets such that A[i] < B[j] < C[k]
- Introduction to Data Structures | 10 most commonly used Data Structures
- Number of subsets with zero sum
- Count of integers of length N and value less than K such that they contain digits only from the given set
- Maximum sum combination from two arrays
- Find m-th smallest value in k sorted arrays
- Minimum cost to reach end of array array when a maximum jump of K index is allowed
- Find the minimum number of operations required to make all array elements equal
- Maximum Sum Subsequence of length k

Given an array arr[0 .. n-1] of distinct integers, the task is to find a local minima in it. We say that an element arr[x]… Read More »

Given two sets of integers as two arrays of size m and n. Find count of minimum numbers that should be removed from the sets… Read More »

Given an array of integers, we need to find out whether it is possible to construct at least one non-degenerate triangle using array values as… Read More »

Given an array of n elements. The task is to count the total number of indices (i, j) such that arr[i] = arr[j] and i… Read More »

Given an array of integers, print the number of pairs in the array that form an amicable pair. Two numbers are amicable if the first… Read More »

Given an array of n elements, find out the maximum possible sum of all elements such that all the elements are equal. Only operation allowed… Read More »

Given three integer arrays and a “sum”, the task is to check if there are three elements a, b, c such that a + b… Read More »

Given an array of n integers. The task is to check whether an arithmetic progression can be formed using all the given elements. If possible… Read More »

Given an integer array, the task is to divide the array into maximum number of sub-arrays such that averages of all subarrays is same. If… Read More »

Given two arrays, the task is that we find numbers which are present in first array, but not present in the second array. Examples :… Read More »

Given an integer array, the task is to divide an integer array into two sub-arrays to make their averages equal if possible. Examples : Input… Read More »

Given an array of n distinct elements, the task is to find all elements in array which have at-least two greater elements than themselves. Examples… Read More »

Given two positive integers X and Y, and an array arr[] of positive integers. We need to find the longest prefix index which contains an… Read More »

Given an array of n distinct and positive elements, the task is to find pair whose sum already exists in given array. Examples : Input… Read More »

Given an unsorted array of integers. Find an element such that all the elements to its left are smaller and to its right are greater.… Read More »