Given current directory and change directory path, return final path.
For Example:
Curent Change Output
/ /facebook /facebook
/facebook/anin ../abc/def /facebook/abc/def
/facebook/instagram ../../../../. /I solved it using stack but unfortunately it took me almost 40 minutes to come up with the solution. Last 5 minutes we discussed about life at facebook.
Generally, Facebook want us to solve 2 question in 45 minutes.
Got Rejected after 2 days.
Related problems: