The Hackerrank Solution For Python