← Back to challenges

Running Athlete πŸƒ

JavaScriptHardregexstringslanguage_fundamentalsinterview

Instructions

  • No description.
  • Guess the code from test cases.

Examples

runningAthlete(["run", "jump", "run", "jump", "run"], "_|_|_") ➞ "_|_|_"

runningAthlete(["run", "jump", "run", "run", "run"], "_|_|_") ➞ "_|_/_"

runningAthlete(["jump", "jump", "jump", "jump", "jump"], "_|_|_") ➞ "x|x|x"

runningAthlete(["run", "run", "run", "run", "run"], "_|_|_") ➞ "_/_/_"

Notes

N/A

javascript
Loading editor…
⌘ ↡ to run
Walks through the solution with reasoning and edge cases.
Next: Let's Sort This Array! β†’