# Category Archives: Arrays (adsbygoogle = window.adsbygoogle || []).push({});

## Find a local minima in an array

Given an array arr[0 .. n-1] of distinct integers, the task is to find a local minima in it. We say that an element arr[x]… Read More »

## Make two sets disjoint by removing minimum elements

Given two sets of integers as two arrays of size m and n. Find count of minimum numbers that should be removed from the sets… Read More »

## Possible to form a triangle from array values

Given an array of integers, we need to find out whether it is possible to construct at least one non-degenerate triangle using array values as… Read More »

## Count of index pairs with equal elements in an array

Given an array of n elements. The task is to count the total number of indices (i, j) such that arr[i] = arr[j] and i… Read More »

## Pairs of Amicable Numbers

Given an array of integers, print the number of pairs in the array that form an amicable pair. Two numbers are amicable if the first… Read More »

## Find maximum array sum after making all elements same with repeated subtraction

Given an array of n elements, find out the maximum possible sum of all elements such that all the elements are equal. Only operation allowed… Read More »

## Find three element from different three arrays such that that a + b + c = sum

Given three integer arrays and a “sum”, the task is to check if there are three elements a, b, c such that a + b… Read More »

## Check whether Arithmetic Progression can be formed from the given array

Given an array of n integers. The task is to check whether an arithmetic progression can be formed using all the given elements. If possible… Read More »

## Break an array into maximum number of sub-arrays such that their averages are same

Given an integer array, the task is to divide the array into maximum number of sub-arrays such that averages of all subarrays is same. If… Read More »

## Find elements which are present in first array and not in second

Given two arrays, the task is that we find numbers which are present in first array, but not present in the second array. Examples :… Read More »

## Divide array into two sub-arrays such that their averages are equal

Given an integer array, the task is to divide an integer array into two sub-arrays to make their averages equal if possible. Examples : Input… Read More »

## Find all elements in array which have at-least two greater elements

Given an array of n distinct elements, the task is to find all elements in array which have at-least two greater elements than themselves. Examples… Read More »

## Longest prefix that contains same number of X and Y in an array

Given two positive integers X and Y, and an array arr[] of positive integers. We need to find the longest prefix index which contains an… Read More »

## Find pairs in array whose sums already exist in array

Given an array of n distinct and positive elements, the task is to find pair whose sum already exists in given array. Examples : Input… Read More »

## Find a partition point in array

Given an unsorted array of integers. Find an element such that all the elements to its left are smaller and to its right are greater.… Read More »