There are N gas stations along a circular route, where the amount of gas at station i is gas. You have a car with an unlimited gas tank and …
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You …
Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as 00111001011110000010100101000000). Follow up: If …
Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and …
At the annual meeting of Board of Directors of Acme Inc, every one starts shaking hands with everyone else in the room. Given the fact that any two persons …