## Element equal to the sum of all the remaining elements

Given an array of N positive elements. The task is to find an element which is equal to the sum of all elements of array… Read More »

## Change K elements so that (a1^2 + a2^2 + …+ aN^2 ) <= (a1 + a2 +…+ aN) becomes true

Given an array Arr of size N. The task is to tell whether it is possible to change at most K elements of this sequence… Read More »

## Absolute Difference of even and odd indexed elements in an Array

Given an array of integers arr, the task is to find the running absolute difference of elements at even and odd index positions separately. Note:… Read More »

## Smallest subarray such that all elements are greater than K

Given an array of N integers and a number K, the task is to find the length of the smallest subarray in which all the… Read More »

## Index with Minimum sum of prefix and suffix sums in an Array

Given an Array of integers. The task is to find the index in the array at which the value of prefixSum(i) + suffixSum(i) is minimum.… Read More »

## Minimum number of elements to be removed so that pairwise consecutive elements are same

Given a string str. The task is to count the minimum number of elements to be removed so that pairwise consecutive elements are same Examples:… Read More »

## Check whether (i,j) exists such that arr[i] != arr[j] and arr[arr[i]] is equal to arr[arr[j]]

Given an array A[]. The task is to determine if it is possible to choose two indices ‘i’ and ‘j’ such that the below conditions… Read More »

## Replace every element with the smallest element on its left side

Given an array of integers, the task is to replace every element with the smallest element on its left side. Note: Replace the first element… Read More »

## Longest subarray with elements having equal modulo K

Given an integer K and an array arr of integer elements, the task is to print the length of the longest sub-array such that each… Read More »

## Replace every element with the greatest element on its left side

Given an array of integers, the task is to replace every element with the greatest element on its left side. Note: Replace the first element… Read More »

## Subtraction in the Array

Given an integer k and an array arr[], the task is to repeat the following operation exactly k times: Find the minimum non-zero element in… Read More »