5 XP challenge
Repeat a Fragment
very easy
Build it yourself · 3 min
1 Learn2 Predict3 Solve
TaskYour mission
Repeat fragment as often as the times input specifies, with no separators, and return the result. fragment has 0 to 5 ASCII letters; times is 0 to 8.
Examples
| Input | Return |
|---|---|
fragment = "ab", times = 3answer: "" → "ab" → "abab" → "ababab". The result is "ababab". | "ababab" |
fragment = "x", times = 0 | "" |
Your code
Write your answer inside Solution, then use return to send it back.
Ln 1, Col 1
JavaScript
Try examples runs the public examples. Check my code checks your full answer and saves your completion.