## Maximum distance between two occurrences of same element in array

Given an array with repeated elements, the task is to find the maximum distance two occurrences of an element. Examples: Input : arr[] = {3,… Read More »

Given an array with repeated elements, the task is to find the maximum distance two occurrences of an element. Examples: Input : arr[] = {3,… Read More »

Given a sequence of positive numbers, find the maximum sum that can be formed which has no three consecutive elements present. Examples: Input: arr[] =… Read More »

Given an array of size n and a number k. We must modify array K number of times. Here modify array means in each operation… Read More »

Given an array of n elements, the task is to find the elements that are greater than half of elements in an array. In case… Read More »

Given array of integer, find the next smaller of next greater element of every element in array. Note : Elements for which no greater element… Read More »

Given an array of integers, the task is to find maximum XOR value of a subarray of size K. Examples: Input : arr[] = {2,… Read More »

Given an array of n elements such that elements may repeat. We can delete any number of elements from array. The task is to find… Read More »

Given an array of positive integers. Find the maximum sum of strictly increasing subarrays. Note that this problem is different from maximum subarray sum and… Read More »

Given an array of integer numbers, we need to find sum of maximum number of all possible subsets. Examples: Input : arr = {3, 2,… Read More »

Given a sorted array of n size, the task is to find whether an element exists in the array from where number of smaller elements… Read More »

Given two arrays which have same values but in different order, we need to make second array same as first array using minimum number of… Read More »

Given array of integers, the task is to find the maximum absolute difference between nearest left and right smaller element of every element in array.… Read More »

Given an array arr[] of non negative integers. We can perform a swap operation on any two adjacent elements in the array. Find the minimum… Read More »

Given an array of n distinct elements, find the minimum number of swaps required to sort the array. Examples: Input : {4, 3, 2, 1}… Read More »

Given an array of integers and a number k. We can pair two number of array if difference between them is strictly less than k.… Read More »