Simplify Path

Given an absolute path for a file (Unix-style), simplify it.
Example
path = "/home/", => "/home"
path = "/a/./b/../../c/", => "/c"
click to show corner cases.

Login to see Answer and Coaching Session More interview questions