moves. There are three kinds of commands:
- "../" moves to the parent folder; if you are already in the top folder, you stay put;
- "./" stays in the current folder;
- "name/" moves into the child folder name (it always exists).
The program starts in the top folder and then runs every command in the log in order. Return how many commands it takes afterwards to get back to the top folder.moves=['docs/', 'drafts/', './', 'old/', '../'] → 2
We go into docs, then drafts; "./" changes nothing; we enter old and step back out. We end up in docs/drafts, two steps below the top.
moves=['../', 'src/', '../', '../'] → 0
You cannot go above the top folder, so the extra "../" do nothing. We finish at the top.
"../", "./", or a folder name of lowercase English letters and digits followed by /moves=['docs/', 'drafts/', './', 'old/', '../']
2
Run checks the first 3 tests in your browser. Submit checks all 77 tests on the server, hidden ones included.