As reported: Capital One Full Stack Engineer CodeSignal assessment, Oct 2026: four questions in 70 minutes — a string manipulation question, a stack-based file-system-commands problem like Simplify Path, a Rotate Image variation where the diagonal elements stay unchanged, and Brightest Position on Street.
Given an absolute Unix-style path, return its simplified canonical path:
.is the current directory;..goes up one level (staying at/at the root);- several consecutive slashes count as one;
- any other name (including
...) is a directory name; - the result starts with a single
/, has single slashes between names, and no trailing slash (except the root/).
This is LeetCode 71 — Simplify Path.
Example
"/home/" -> "/home"
"/../" -> "/"
"/home//foo/" -> "/home/foo"
"/a/./b/../../c/" -> "/c"
Constraints: 1 ≤ path.length ≤ 3000; letters, digits, ., / and _; path is a valid absolute path.
Code runner format: one line with path as a JSON string. Implement simplifyPath(path); the harness prints the result.