Binary Hierarchy Node Role Tagging - Coding problem | OneNoughtOne