Skip to content

Latest commit

 

History

History
24 lines (23 loc) · 4.13 KB

35-string-repeat.md

File metadata and controls

24 lines (23 loc) · 4.13 KB

Problem:

Write a function called repeatString which repeats the given String src exactly count times.

repeatStr(6, "I") // "IIIIII"
repeatStr(5, "Hello") // "HelloHelloHelloHelloHello"
repeatStr(6, "I") /* "IIIIII" */
repeatStr(5, "Hello") //*"HelloHelloHelloHelloHello" */
repeatStr(6, "I") -- "IIIIII"
repeatStr(5, "Hello") -- "HelloHelloHelloHelloHello"
repeat_str(6, "I") # "IIIIII"
repeat_str(5, "Hello") # "HelloHelloHelloHelloHello"
StringRepeat.repeatStr(6, "I") # "IIIIII"
StringRepeat.repeatStr(5, "Hello") # "HelloHelloHelloHelloHello"
repeatStr(6, "I") # "IIIIII"
repeatStr(5, "Hello") # "HelloHelloHelloHelloHello"
repeatstr(6, "I") # "IIIIII"
repeatstr(5, "Hello") # "HelloHelloHelloHelloHello"
repeatstr(6, "I") # "IIIIII"
repeatstr(5, "Hello") # "HelloHelloHelloHelloHello"
repeatString(6, "I") // "IIIIII"
repeatString(5, "Hello") // "HelloHelloHelloHelloHello"
(repeat-string 6 "I") ; "IIIIII"
(repeat-string 5 "Hello") ; "HelloHelloHelloHelloHello"

Solution