Split the input path by '/' to get the path components.
Iterate over each component in the path.
a. If the component is '.' or an empty string, continue to the next component.
b. If the component is '..', pop from the stack if it is not empty.
c. If the component is a valid directory name, push it onto the stack.
Join all the elements in the stack with '/' to form the simplified path.
Ensure the simplified path starts with '/' and does not end with '/' unless the path is just '/'.
Return the simplified path.
Using String Manipulation to Simplify Unix File Path