Startup小公司 Braze电面

Given an absolute path for a file (unix style), simplify it so it returns a canonical path.

Some example:

/home => /home
/a/./b/…/…/c => /c
/a/b/… => /a
/a/./b/ => /a/b
/…/ => /

原题 Simplify Path

1 Like

:+1::+1:厉害了 这都有
我是拿Stack做的 遇到..就是pop