## Min difference between maximum and minimum element in all Y size subarrays

Given an array arr[] of size N and integer Y, the task is to find a minimum of all the differences between the maximum and… Read More »

- Product of all Subarrays of an Array
- Sliding Window Maximum : Set 2
- Perfect Sum Problem
- Minimize the maximum difference between adjacent elements in an array
- Eggs dropping puzzle | Set 2
- Minimum number of swaps required to sort an array of first N number
- Efficiently merging two sorted arrays with O(1) extra space and O(NlogN + MlogM)
- Find XOR of all elements in an Array
- Split the given string into Primes : Digit DP
- Number of pairs in an array with the sum greater than 0
- Count of subsets with sum equal to X using Recursion
- Check if sum of Fibonacci elements in an Array is a Fibonacci number or not
- Count of subarrays of an Array having all unique digits
- Check if an array is sorted and rotated using Binary Search
- Maximum number of unique values in the array after performing given operations
- Count of subarrays having exactly K perfect square numbers
- Move all zeroes to end of array using Two-Pointers
- Search an element in a sorted and rotated array with duplicates
- Longest alternating subsequence in terms of positive and negative integers
- Minimum salary hike for each employee such that no employee feels unfair
- How to flatten a Vector of Vectors or 2D Vector in C++
- Median of an unsorted array using Quick Select Algorithm
- Minimize the maximum difference of adjacent elements after at most K insertions
- Maximum LCM among all pairs (i, j) from the given Array
- Minimum number of operations to convert array A to array B by adding an integer into a subarray
- Count of subarrays which start and end with the same element
- Maximum number of overlapping Intervals
- Kth most frequent Character in a given String
- Maximum GCD of all subarrays of length at least 2
- Check if its possible to make sum of the array odd with given Operations

Given an array arr[] of size N and integer Y, the task is to find a minimum of all the differences between the maximum and… Read More »

Given an array arr[] of size N and a matrix Q consisting of queries of the following two types: 1 L R : Print the… Read More »

Given an array arr[] of length N and an integer K, the task is to find the longest subarray with difference between any two distict… Read More »

Given an array arr[], the task is to maximize the sum of even-indexed elements by reversing a subarray and print the maximum sum obtained. Examples:… Read More »

Given an array freq[] which stores the frequency of N integers from 0 to N – 1. The task is to construct a sequence where… Read More »

Given an integer array arr[] of size N, the task is to find the minimum distance between any most and least frequent element of the… Read More »

Given an array arr[] of N positive integers where the integers are in the range from 1 to N, the task is to check whether… Read More »

Given an integer N in form of string str consisting of more than 100 digits, the task is to store the value for performing an… Read More »

Given an integer array arr[] of size N, the task is to count the total number of distinct pairs having minimum absolute difference. Examples: Input:… Read More »

Given an array arr[] of N integers, the task is to replace each element of Array with their rank in array. The rank of an… Read More »

Given an array arr[] consisting of N positive integers, the task is to print all pairs of array elements whose sum does not exist in… Read More »

Given an array arr[] of N positive integers and a positive integer M, the task is to find the length of longest subset whose smallest… Read More »

Given an array arr[] of size N, the task is to find the number of non-empty subsequences from the given array such that no two… Read More »

Given an integer array arr[], the task is to find the largest sum contiguous subarray of non-negative elements and return its sum. Examples: Input: arr[]… Read More »

Given an arr[] of size N whose elements are sorted in descending order. The task is to find if the given array can be sorted… Read More »