You start in the top folder, written "/". Each move is either a folder name, which steps into that folder inside the one you're in, or "..", which steps back out to the parent. At "/" there is no parent, so ".." does nothing.
Write current_folders(moves: list[str]) -> list[str] that returns, after each move, the name of the folder you're in ("/" at the top).
current_folders(["docs", "notes", "..", "pics", "..", "..", ".."])
# ["docs", "notes", "docs", "pics", "docs", "/", "/"]
current_folders(["a", "a", ".."]) # ["a", "a", "a"] (a folder "a" inside a folder "a")
current_folders([]) # []
Constraints: up to 10^4 moves; folder names use letters and digits only.
Show hint
keep the folders you're inside in a list used as a stack: append a name, pop on "..", and the top is where you are.