This is a kind of "two snakes" game
1234
snake1 snake2
1 push
2 push
1
3 push
2
1
3 push
2 push
3
1 push -> ready to pop
2
3
so push in 2nd stack if empty.
Early Tumblr Investors USV And Spark Capital Got ~ $192 Million Each From
Yahoo Sale
-
[image: fred wilson]
Yesterday, it was reported that one of Tumblr's earliest investors, Union
Square Ventures, received a 5,000% return on investment wh...
10 minutes ago
Have 2 stacks(say stack1 and stack2). Push into one stack (say stack1)
ReplyDeleteTo perform pop operation, check if stack2 contains any element,if yes then pop stack2. else transfer n-1 elements from stack1 to stack2 and return nth element.