## Move all zeros to start and ones to end in an Array of random integers

Given an array arr[] of random integers, the task is to push all the zero’s in the array to the start and all the one’s… Read More »

## Replace array elements by sum of next two consecutive elements

Given an array arr[] of size n, The task is to replace every element of the array by the sum of next two consecutive elements… Read More »

## Maximum number of continuous Automorphic numbers

Given an array of N elements. The task is to find the maximum number of the contiguous automorphic numbers in the given array. Automorphic Numbers:… Read More »

## Character whose frequency is equal to the sum of frequencies of other characters of the given string

Given a string str consisting of lowercase English alphabets. The task is to find whether there is any character in the string whose frequency is… Read More »

## Find the first maximum length even word from a string

Given a string of words separated by spaces. The task is to find the first maximum length even word from the string. Eg: “You are… Read More »

## Print direction of moves such that you stay within the [-k, +k] boundary

Given an array arr[] of N positive integers and an integer K. It is given that you start at position 0 and you can move… Read More »

## Minimize sum of adjacent difference with removal of one element from array

Given an array of positive integers of size greater than 2. The task is to find the minimum value of sum of consecutive difference modulus… Read More »

## Group consecutive characters of same type in a string

Given a string str consisting of upper case alphabets, numeric digits and arithmetic operators, the task is to group them into continuous sub-strings of same… Read More »

## Pick maximum sum M elements such that contiguous repetitions do not exceed K

Given an array arr[] of distinct elements and two integers M and K, the task is to generate an array from the given array elements… Read More »

## Minimum cost to make two strings same

Given four integers a, b, c, d and two strings S1 and S2 of equal length, which consist only of the characters ‘2’, ‘1’ and… Read More »

## Maximum occurrence of prefix in the Array

Given a string consisting of lower case English Alphabets. The task is to count the number of occurrences of the non-empty prefix which occurs the… Read More »

## Longest Sub-array with maximum average value

Given an array arr[] of n integers. The task is to find the maximum length of the sub-array which has the maximum average value (average… Read More »

## Maximum length subarray with difference between adjacent elements as either 0 or 1

Given an array of n integers. The task is to find the maximum length of the sub-array such that absolute difference between all the consecutive… Read More »

## Minimum elements to be removed such that sum of adjacent elements is always even

Given an array of N integers. The task is to eliminate the minimum number of elements such that in the resulting array the sum of… Read More »

## Count array elements that divide the sum of all other elements

Given an array arr[], the task is to count the number of elements from the array which divide the sum of all other elements. Examples:… Read More »