Hackerrank Repeated String Solutions