about | help | code help+videos | done | prefs |
The array "moves" contains a series of directions to move choosing from up, down, left, or right and moving exactly one space per move. backToStart returns true if the final move returns you to your starting location. You may cross through your starting location along the way, but do not return true unless your final move places you at your starting location. Return false if you do not end at the starting location. backToStart(["down", "right", "down", "right", "up", "right", "left", "up", "left", "left"]) → true backToStart(["down", "right", "down", "right", "up", "up", "left", "up", "left", "left"]) → false backToStart(["down", "down", "down", "right", "down", "up", "down", "up", "left", "left"]) → false ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 285
Copyright Nick Parlante 2017 - privacy