Optiver Interview Question

HackerRank - Binary Tree & basic java program