Amazon Coding Question : Lost in the Forest