feat(content): hidden test cases
This commit is contained in:
@@ -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**.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user