Repeated String Hackerrank Solution Python