# Category: Array

## Find count of distinct elements in every sub-array of size k

Given an array and an integer k, find the count of distinct elements in every sub-array of size k in the array.

## Find two numbers with maximum sum formed by array digits

Given an array of integers between 0 to 9, find two numbers with maximum sum formed by using all digits of the array. The difference in number of digits of the two numbers should be ± 1.

## Print all sub-arrays of an array having distinct elements

Given an array of integers, print all maximum size sub-arrays having all distinct elements in them.

## Find a Triplet having Maximum Product in an Array

Given an array of integers, find a triplet having maximum product in the array.

## Find ways to calculate a target from elements of specified array

Write a program to count number of ways to calculate a target number from elements of specified array by using only addition and subtraction operator. The use of any other operator is forbidden.

## Find Minimum Index of Repeating Element in an Array

Given an array of integers, find minimum index of a repeating element in linear time and doing just one traversal of the array.

## Generate Random Input from an Array according to given Probabilities

Write an algorithm to generate any one of the given N numbers according to given probabilities.

## Find pair in an array having minimum absolute sum

Given an sorted array of integers, find a pair in it having minimum absolute sum.

## Find Index of Maximum Occurring Element with Equal Probability

Given a collection of integers, develop an algorithm to find the index of maximum occurring element with equal probability.

## Check if an Array is Formed by Consecutive Integers

Given an array of integers, check if an array is formed by consecutive integers.

## Find the odd occurring element in log(n) time

Given an array of integers where every element appears even number of times except one element which appears odd number of times, find that odd occurring element in O(log(n)) time and constant space.

## Find two non-overlapping pairs having same sum in an array

Given an unsorted array of integers, find two non-overlapping pairs in it having same sum.