Migratory Birds Hackerrank Solution