Amazon Interview Question

graphs question like rotten oranges