Hackerrank Repeated String Solution