Embedded Tree Detection - Coding problem | OneNoughtOne