FB phone interview
Anonymous User
587

https://leetcode.com/problems/binary-tree-vertical-order-traversal/

The first one I did a BFS followed by a sort.. 1st solution on leetcode. I was too nervous, going to the second solution would be intuitive if I weren't so overwhelmed...

u have a string consisting of +,*,[0-9] return the evaluation of expression: 4+3 * 5+6 return 25 -->
I did a stack solution. for each number, if it was an add, I'd put it in the stack. if it was a multiply, I'd pop the last number from stack and multiply. put the multiplied back in. At the end, I'd be left with all adds in stack, add them up and return..

Comments (3)