Given an array of integers, find the nearest smaller number for every element such that the smaller element is on left side.
Examples:
Input: arr[] = {1, 6, 4, 10, 2, 5} Output: {-1, 1,… Read More
Interview Questions asked in Google, Microsoft, Amazon
by Dhaval Dave
Given an array of integers, find the nearest smaller number for every element such that the smaller element is on left side.
Examples:
Input: arr[] = {1, 6, 4, 10, 2, 5} Output: {-1, 1,… Read More
by Dhaval Dave
(Below is the table of price rule) Come up with data structure you can store these price rules
by Dhaval Dave
With First look you think practical way of solving this question, and that is randomly taking a bolt and finding (by Looking at all nuts) perfect fit nut for it.
but does such logic to … Read More
by Dhaval Dave
Power Set Power set P(S) of a set S is the set of all subsets of S. For example S = {a, b, c} then P(s) =
by Dhaval Dave
Stock Price on each day is given in an array.
Example : [ 10, 12, 7, 5, 9, 15, 13, 18 ]
Find the max profit that you can make by buying and selling in … Read More
by Dhaval Dave
Given an array of integers, find out the difference between any two elements such that larger element appears after the smaller number.
Examples: … Read More
by Dhaval Dave
by Dhaval Dave
We have array a[ ]= {1, 2, 3, 4, 5, 6, 7, 8, 4, 10};
And we need to find a number which is duplicate in O(n) and Space complexity O(1)
Method 1 ) Sorting
by Dhaval Dave
by Dhaval Dave