## Lexicographical smallest alternate Array

Given an array arr[] of distinct elements, the task is to rearrange the array such that it is lexicographically smallest and of the form arr[0]… 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
- Building Heap from Array
- Find k closest numbers in an unsorted array
- Amazon Internship Interview Experience
- Check if given Preorder, Inorder and Postorder traversals are of same tree | Set 2
- Create linked list from a given array
- Maximum sum such that no two elements are adjacent | Set 2
- Maximum Sum Subsequence of length k
- Sort an array without changing position of negative numbers
- Maximum absolute difference in an 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
- Kth smallest element in a subarray
- Count the triplets such that A[i] < B[j] < C[k]
- Find the longest string that can be made up of other strings from the array
- Find minimum difference between any two elements | Set 2
- Partition an array of non-negative integers into two subsets such that average of both the subsets is equal
- Introduction to Data Structures | 10 most commonly used Data Structures
- Count of integers of length N and value less than K such that they contain digits only from the given set
- Number of subsets with zero sum
- Split the given array into K sub-arrays such that maximum sum of all sub arrays is minimum
- Maximum sum combination from two arrays
- Greatest contiguous sub-array of size K
- Remove duplicate elements in an Array using STL in C++
- Find the smallest positive number missing from an unsorted array | Set 3
- 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
- Pair with largest sum which is less than K in the array

Given an array arr[] of distinct elements, the task is to rearrange the array such that it is lexicographically smallest and of the form arr[0]… Read More »

Given N bottles. The ith bottle has A[i] radius. Once a bottle is enclosed inside another bottle, it ceases to be visible. The task is… Read More »

Given an unsorted array with both positive and negative elements. The task is to find the smallest positive number missing from the array. Examples: Input:… Read More »

Given an array of pairs arr of size N which represents a game situation where the first player wins against the second player. Given multiple… Read More »

Given an array a of size N. The task is to find the sum of the sums of all possible subsets. Examples: Input: a[] =… Read More »

Given an array a of size N. The task is to print the length of the longest alternative odd/even or even/odd subsequence. Examples: Input: a[]… Read More »

Given an array of N integers. The task is to find the lexicographically smallest array possible by applying the given operation any number of times.… Read More »

Given an array a of size N. The task is to find a subsequence X of length K such that gcd(X[0], X[1]) + (X[2], X[3])… Read More »

Given an array arr[] of N integers. The task is to find the largest elements in the first half and the second half of the… Read More »

Given an array of integers arr[], the task is to print a list of all the peaks and another list of all the troughs present… Read More »

Given an array arr[] of integers, the task is to find the sum of even elements from the array. Examples: Input: arr[] = {1, 2,… Read More »

Given two arrays X and L of same size N. Xi represents the position in an infinite line. Li represents the range up to which… Read More »

Given an array a of size N and an integer K. The task is to find the maximum bitwise and value of elements of any… Read More »

Given an array a[] of size N. The value of a subset is the product of primes in that subset. A non-prime is considered to… Read More »

Given an array A of size N (> 2). The task is to find the maximum value of A[i] / A[j] Note: A[i] ≠ 0.… Read More »