# Category Archives: Arrays

## Count number of ways to jump to reach endMay 20, 2017

Given an array of numbers where each element represents the max number of jumps that can be made forward from that element. For each array… Read More »

## Sort an array after applying the given equation

We have an integer array that is sorted in ascending order. We also have 3 integers A, B and C. We need to apply A*x*x… Read More »

## k-th distinct (or non-repeating) element in an array.May 19, 2017

Given an integer array, print k-th distinct element in an array. The given array may contain duplicates and the output should print k-th element among… Read More »

## Count the number of ways to divide an array into three contiguous parts having equal sumMay 18, 2017

Given a array of n numbers. Our task is to find out the number of ways to divide the array into three contiguous parts such… Read More »

## Check if it is possible to sort an array with conditional swapping of adjacent allowed

We are given an unsorted array of integers in the range from 0 to n-1. We are allowed to swap adjacent elements in array many… Read More »

## Find duplicates in a given array when elements are not limited to a rangeMay 17, 2017

Given an array of n integers. The task is to print the duplicates in the given array. If there are no duplicates then print -1.… Read More »

## Number of subarrays for which product and sum are equal

Given a array of n numbers. We need to count the number of subarrays having the product and sum of elements are equal Examples: Input… Read More »

## Program for multiplication of array elements

We are given an array and we have to calculate the product of an array using both iterative and recursive method. Examples: Input : array[]… Read More »

## Find whether a subarray is in form of a mountain or notMay 15, 2017

We are given an array of integers and a range, we need to find whether the subarray which falls in this range has values in… Read More »

## Maximum sum two non-overlapping subarrays of given sizeMay 14, 2017

Given an array, we need to find two subarrays with a specific length K such that sum of these subarrays is maximum among all possible… Read More »

## Clustering/Partitioning an array such that sum of square differences is minimumMay 13, 2017

Given an array of n numbers and a number k. We need to divide the array into k partitions (clusters) of same or different length.… Read More »

## Find whether it is possible to make array elements same using one external numberMay 12, 2017

Given an Array, three operations can be performed using any external number x. Add x to an element once Subtract x from an element once… Read More »

## Remove minimum elements from array such that no three consecutive element are either increasing or decreasing

Given an array of n distinct positive integers. The task is to find the minimum number of elements to be removed such that no three… Read More »

## Smallest Difference pair of values between two unsorted ArraysMay 11, 2017

Given two arrays of integers, compute the pair of values (one value in each array) with the smallest (non-negative) difference. Return the difference. Examples: Input… Read More »

## Program to print an array in Pendulum ArrangementMay 10, 2017

Write a program to input a list of integers in an array and arrange them in a way similar to the to-and-fro movement of a… Read More »