Tree Top View Hackerrank Solution In Python