Array, is a data structure consisting of a collection of elements (values or variables), each identified by at least one array index or key. An array is stored so that the position of each element can be computed from its index tuple by a mathematical formula. The simplest type of data structure is a linear array, also called one-dimensional array.

Learn more..

Find largest number possible from set of given numbers

Given an array of integers, find the largest number possible. The numbers should be appended to each other in any order to form the largest number. Return this number in string format. Example Solut ...
Murat Sütunç
Published on Nov 16th, 2017

Maximum subarray problem

Given an array of integers, find the contiguous subarray within it which has the largest sum. Return the sum. Example Solution Let array arr equal to [ -2, 1, -3, 4, -1, 2, 1, -5, 4 ]. Subarray wit ...
Murat Sütunç
Published on Nov 16th, 2017

Find maximum difference between two elements in the array

Given an array of integers, find the maximum difference between two elements in the array such that the index of smaller element is also smaller than the index of the larger element. Return the diffe ...
Murat Sütunç
Published on Nov 16th, 2017

Find Longest Bitonic Subarray in an array

A sequence is called Bitonic if it is first increasing, then decreasing. In other words, an array arr[0..n-i] is Bitonic if there exists an index i where `0 = xi+1 >= … >= xn-1 A sequence, sorted in ...
Murat Sütunç
Published on Nov 16th, 2017

Replace each element of the array with product of every other element

Given an array of integers, replace each element of the array with the product of every other element in the array. Return the modified array. Example Solution Let array arr equal to [ 1, 2, 3, 4, ...
Murat Sütunç
Published on Nov 16th, 2017

Move all zeros present in the array to the end

Given an array of integers, move all zeros present in the array to the end. The solution should maintain the relative order of items in the array. Return the modified array. Example Solution Let ar ...
Murat Sütunç
Published on Nov 16th, 2017

Find Equilibrium Index of an Array

Equilibrium index of an array is an index such that the sum of elements at lower indexes is equal to the sum of elements at higher indexes. For example, in an array A: (A[0] + A[1] + ... + A[i-1]) = ...
Murat Sütunç
Published on Nov 16th, 2017

Rearrange the array with alternate high and low elements

Given an array of integers, rearrange the array such that every second element of the array is greater than its left and right elements. Assume no duplicate elements are present in the array. Exampl ...
Murat Sütunç
Published on Nov 16th, 2017

Find index of 0 to be replaced to get maximum length sequence of continuous ones

Given a binary array, find the index of 0 to be replaced with 1 to get the maximum length sequence of continuous 1s. Return that index. Example Solution Let array arr equal to [ 0, 0, 1, 0, 1, 1, 1 ...
Murat Sütunç
Published on Nov 16th, 2017

Merge two arrays by satisfying given constraints

Given two sorted integer arrays arr1 and arr2 where length of arr1 is equal or larger than length of arr2. The array arr1 has exactly x vacant cells, which is equal to the difference in length betwee ...
Murat Sütunç
Published on Nov 16th, 2017