TTsurutani / HackerRankExam

0 stars 0 forks source link

Repeated String:長いlengthはダメ #29

Closed TTsurutani closed 6 years ago

TTsurutani commented 6 years ago

https://www.hackerrank.com/challenges/repeated-string/problem

シンプルにこう書いたが、効率が悪いらしい

rs str n = length.filter (== head str).take n .cycle $ str