← Questions
Resolve a cd command to an absolute path
0
I was asked this
No reports yet. Sign in to say where you were asked it.
Write a function that takes the current directory and the argument to cd, and returns the directory pwd would print afterwards. Handle ., .., repeated and trailing slashes, and absolute targets. Later parts add shortcuts such as a home directory and symbolic links that remap one path prefix to another, including links that point at each other.
No official answer yet. Write yours on the right and run it.
Nothing published yet.
Write and test your solution herePython in your browser, the question's tests level by level, saved for you.Sign in to start coding

