##
Type of array and its maximum element
March 8, 2017

Given an array, it can be of 4 types (a) Ascending (b) Descending (c) Ascending Rotated (d) Descending Rotated Find out which kind of array… Read More »

March 8, 2017

Given an array, it can be of 4 types (a) Ascending (b) Descending (c) Ascending Rotated (d) Descending Rotated Find out which kind of array… Read More »

March 7, 2017

Given a sorted array of positive integers, rearrange the array alternately i.e first element should be the maximum value, second minimum value, third-second max, fourth-second… Read More »

March 4, 2017

Given four arrays and an integer x, find the number of quadruples which satisfy a^b^c^d = x, where a belongs from Arr1, b belongs from… Read More »

March 3, 2017

Given an array arr[], find the lexicographically smallest array that can be obtained after performing at maximum of k consecutive swaps. For example:- Input: arr[]… Read More »

March 2, 2017

Given an array arr[] of size n, we need to find sum of all the values that comes from XORing all the elements of the… Read More »

Given a sorted array with possibly duplicate elements, the task is to find indexes of first and last occurrences of an element x in the… Read More »

Given an array of n integers. The task is to find the sum of sum of each of sub-sequence of the array. Examples: Input :… Read More »

March 1, 2017

A sorted array contains 6 different numbers, only 1 number is repeated five times. So there are total 10 numbers in array. Find the duplicate… Read More »

February 28, 2017

Given an array of N integers where N is even. There are two kinds of operations allowed on the array. Increase the value of any… Read More »

February 27, 2017

Given an array, find maximum sum of smallest and second smallest elements chosen from all possible subarrays. More formally, if we write all (nC2) subarrays… Read More »

February 26, 2017

Given binary array, find count of maximum number of consecutive 1’s present in the array. Examples: Input : arr[] = {1, 1, 0, 0, 1,… Read More »

Given an array of distinct elements. The task is to find triplets in array whose sum is zero. Examples: Input : arr[] = {0, -1,… Read More »

February 23, 2017

Given an array of size N which is initialized with all zeros. We are given many range add queries, which should be applied to this… Read More »

February 22, 2017

Given an integer array ‘arr[]’ of size n, find sum of all sub-arrays of given array. Examples: Input : arr[] = {1, 2, 3} Output… Read More »

We have an array of integers and we have to find two such elements in the array such that sum of these two elements is… Read More »