Reported interview periodNot available
Resolve a cd target against a working directory
You are given an absolute working directory and the argument of a cd command. Return the absolute directory the shell would land in once ., .., and repeated separators are collapsed.
Practice focusRequirements - Line 1 is an absolute working directory; line 2 is the argument, which may be absolute or relative. - An absolute argument discards the working directory and is resolved from the root. - . keeps the current directory, .. moves to the parent, and climbing past the root stays at / . - Only a whole segment equal to . or .. is special; a name such as file..name remains one segment. - Return the path with one leading slash, no repeated or trailing separators, and / alone when nothing remains.…