Find largest sub-array formed by consecutive integers

Given an array of integers, find largest sub-array formed by consecutive integers. The sub-array should contain all distinct values. Return the sub-array. Example Solution When the solution is call ...
Murat Sütunç
Published on Oct 13th, 2017

Find maximum length sub-array having equal number of 0's and 1's

Given an binary array containing 0's and 1's, find the maximum length sub-array having equal number of 0's and 1's. Return the first sub-array. Example Solution When the solution is called with the ...
Murat Sütunç
Published on Oct 13th, 2017

Find maximum product of two integers in an array

Given an array of integers, find the maximum product of two integers in an array. Return the elements of this array. If there are more than one satifying answer, pick the pair whose sum is greater th ...
Murat Sütunç
Published on Oct 13th, 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. Example Solution When the solution is called with ...
Murat Sütunç
Published on Oct 13th, 2017

Determine if two strings are anagram or not

Any word that exactly reproduces the letters in another order is an anagram. In other words, X and Y are anagrams if by rearranging the letters of X, we can get Y using all the original letters of X ...
Murat Sütunç
Published on Oct 13th, 2017

Check if given set of moves is circular or not

A rover is given instructions such as Move (M), Left (L) and Right (R). Check if given set of moves is circular or not. If circular return true, otherwise return false. The move is circular if its st ...
Murat Sütunç
Published on Oct 13th, 2017

Longest even length palindromic sum substring

Find the length of longest contiguous substring of a string, such that the length of the substring is 2 * N digits and the sum of the leftmost N digits is equal to the sum of the rightmost N digits. ...
Murat Sütunç
Published on Oct 13th, 2017

Validate an IP address

Write a solution to validate an IPv4 address. IPv4 addresses are canonically represented in dot-decimal notation, which consists of four decimal numbers, each ranging from 0 to 255, separated by dot ...
Murat Sütunç
Published on Oct 13th, 2017

Find all possible combinations of words formed from mobile keypad

The standard 12-key telephone keypad looks like the following: To write text using the keypad you have to press the number keys. For example, to write X press the key 9 twice. Given a sequence of nu ...
Murat Sütunç
Published on Oct 13th, 2017

Find pair with given sum in the array

Given an unsorted array of integers, find the first pair with given sum in it. Return the index for these integers. Example Solution When the solution is called with the following input arr = [8, 7, ...
Murat Sütunç
Published on Oct 4th, 2017