## Order of indices which is lexicographically smallest and sum of elements is <= X

Given an array arr[] and an integer X, the task is to find the indices such that: The sum of elements on the found indices… 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[] and an integer X, the task is to find the indices such that: The sum of elements on the found indices… Read More »

Given an unsorted array arr[] of size n, the task is to find the minimum difference between any pair in the given array. Input: arr[]… Read More »

Given a permutation from 1 to N of size N. Find the length of the longest subsequence having the property that the first and last… Read More »

Given an array arr[] of N elements. The task is to find the number of sub-sequences which have at least two consecutive elements such that… Read More »

Given an array arr[] of size N, the task is to generate and print all permutations of the given array. Examples: Input: arr[] = {1,… Read More »

Given an array of integers. The task is to rearrange elements of the array such that no two adjacent elements in the array are same.… Read More »

Given an array, the task is to create a new sorted array in ascending order from the elements of the given array. Examples: Input :… Read More »

Given an integer array ‘arr’ of length N and an integer ‘k’, select some non-overlapping subarrays such that each sub-array if of length at most… Read More »

Given an integer N, for every integer i in the range 2 to N, assign a positive integer such that the following conditions hold :… Read More »

Given two arrays a1[] and a2[], print elements of a1 in such a way that the relative order among the elements will be the same… Read More »

Given an array arr[] of size N, the task is to generate and print all possible combinations of R elements in array. Examples: Input: arr[]… Read More »

Given an array arr[] of N integers, the task is to find the longest sub-sequence in the given array such that for all pairs from… Read More »

Given an array “arr[0..n-1]” of integers. The task is to calculate the sum of Bitwise OR of all pairs, i.e. calculate the sum of “arr[i]… Read More »

Given an array of integers arr[], the task is to find the sum of all the Mersenne numbers from the array. A number is a… Read More »

Given an array of N elements. Find the subset of elements which has maximum sum such that no two elements in the subset has common… Read More »