1
var repeatedStringMatch = function (a, b) {
2
const initRepeatTimes = Math.ceil(b.length / a.length);
3
const isMatch = (times) => a.repeat(times).includes(b);
4

5
if (isMatch(initRepeatTimes)) return initRepeatTimes;
6
if (isMatch(initRepeatTimes + 1)) return initRepeatTimes + 1;
7
return -1;
8
};

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0