Amazon Interview Question

Q: rotten oranges Q: right side view of binary tree