You need to log in or create an account to post to this user's Wall.
The Hashtable idea works (you actually just need a HashSet). For every element in your HashSet you need to do two lookups, because of your absolute value.
e – x = D
- (e – x) = Dx = e – D
x = D + enotelite joined the group Amazon Interview 9 months, 4 weeks ago
In a perfect BST, where every parent has two children, the root is the median. If you add or remove a node, it’s no longer a perfect tree.
In the following BST the median is 3, but the root is 4.
Caopengs solution works quite well and is easy to understand if you know that j is the currMax and k is the nextMax.
I couldn’t get GU’s code to work since there are several compile errors and it wasn’t […]
My code for reverseNodeInKGroup passes the small judge for Java, but I get a timeout for the large judge. Can you spot why my code timesout? Has anybody gotten the large judge for Java to pass?
public […]
My solution passes the small and large test. It is just recursive backtracking. You want to check if the string is even a possibility in the grid. The grid might be missing some of the letters in the string. […]
notelite joined the group General Help 1 year ago
All of the tests passed for my SolveSudoku program, but there are some strange timeouts possible with the test cases. My code uses the unknown position with the fewest number of possible moves. There may be […]
notelite joined the group Google Interview 1 year ago
I get the same thing too.
Rishabh jain joined the group Facebook Interviews 1 year, 1 month ago
The online judge want you to implement ”int sqrt (int)”. Was it supposed to be ”float sqrt(float)”? If not, what should the output of sqrt 3 be?
Rishabh jain became a registered member 1 year, 1 month ago
