Skip to content

Commit 1d5374d

Browse files
committed
fix my own stupidity - read the instructions
1 parent 602f4d6 commit 1d5374d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Sprint-3/2-practice-tdd/repeat-str.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function repeatStr(stringOfCharacters, count) {
44
if (count === 0) {
55
return "";
66
} else if (count > 0) {
7-
return stringOfCharacters.repeat(count);
7+
return repeatStr(stringOfCharacters, count - 1) + stringOfCharacters;
88
}
99
throw Error("Invalid input: count must be a non-negative integer");
1010
}

0 commit comments

Comments
 (0)