feat(content): function signatures + test cases

This commit is contained in:
2025-07-13 19:53:34 +01:00
parent 9e6c6d256f
commit 65a8d525f5
203 changed files with 4526 additions and 0 deletions

View File

@@ -9,6 +9,22 @@ categories:
patterns:
- backtracking
function_signature: "def ambiguous_coordinates(s: str) -> list[str]:"
test_cases:
visible:
- input: { s: "(123)" }
expected: ["(1, 2.3)", "(1, 23)", "(1.2, 3)", "(12, 3)"]
- input: { s: "(0123)" }
expected: ["(0, 1.23)", "(0, 12.3)", "(0, 123)", "(0.1, 2.3)", "(0.1, 23)", "(0.12, 3)"]
hidden:
- input: { s: "(00011)" }
expected: ["(0, 0.011)", "(0.001, 1)"]
- input: { s: "(100)" }
expected: ["(10, 0)", "(1, 0.0)"]
- input: { s: "(12)" }
expected: ["(1, 2)"]
description: |
We had some 2-dimensional coordinates, like `"(1, 3)"` or `"(2, 0.5)"`. Then, we removed all commas, decimal points, and spaces and ended up with the string `s`.