Coders Daily Hackerrank Python Solution