You have given height array of array. Generate the original array.
Input: [6,3,0,2,2,0,0] Output : [ 1,5,7,3,2,6,4]
A[i] value in input array is the number of greater element on right side.
Given an array of sorted integers and find the closest value to the given number. Array may contain duplicate values and negative numbers.
Example : Array : 2,5,6,7,8,8,9 Target number : 5 Output : 5
Target number : 11 Output : 9
Target Number : 4 Output : 5
Given an unsorted array which has a number in the majority (a number appears more than 50% in the array), how to find that number?
Say you are given two arrays where second array is duplicate with one missing element. What should be the best possible way to find that missing element - array1: [1,2,3,4,5,6,7] array2: [1,3,4,5,6,7]
Missing Element: 2