Your question is Simplify Nested Path String. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given a string path representing a slash-separated path, return its canonical simplified form. The path may contain repeated slashes, . segments for the current directory, and .. segments for the parent directory. The result must start with a single /, contain no trailing slash unless it is the root, and never move above root.
., _, -, and //def simplify_path(path):