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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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. ...
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 ...
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 ...
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, ...