feat(content): hidden test cases

This commit is contained in:
2025-08-06 23:21:42 +01:00
parent 72f7833c6c
commit a1a4eeaed7
134 changed files with 2075 additions and 0 deletions

View File

@@ -9,6 +9,30 @@ categories:
patterns:
- monotonic-stack
function_signature: "def simplify_path(path: str) -> str:"
test_cases:
visible:
- input: { path: "/home/" }
expected: "/home"
- input: { path: "/home//foo/" }
expected: "/home/foo"
- input: { path: "/home/user/Documents/../Pictures" }
expected: "/home/user/Pictures"
hidden:
- input: { path: "/../" }
expected: "/"
- input: { path: "/.../a/../b/c/../d/./" }
expected: "/.../b/d"
- input: { path: "/a/./b/../../c/" }
expected: "/c"
- input: { path: "/" }
expected: "/"
- input: { path: "/a//b////c/d//././/.." }
expected: "/a/b/c"
- input: { path: "/..hidden" }
expected: "/..hidden"
description: |
You are given an *absolute* path for a Unix-style file system, which always begins with a slash `'/'`. Your task is to transform this absolute path into its **simplified canonical path**.