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

@@ -10,6 +10,28 @@ categories:
patterns:
- bfs
function_signature: "def open_lock(deadends: list[str], target: str) -> int:"
test_cases:
visible:
- input: { deadends: ["0201", "0101", "0102", "1212", "2002"], target: "0202" }
expected: 6
- input: { deadends: ["8888"], target: "0009" }
expected: 1
- input: { deadends: ["8887", "8889", "8878", "8898", "8788", "8988", "7888", "9888"], target: "8888" }
expected: -1
hidden:
- input: { deadends: ["0000"], target: "1111" }
expected: -1
- input: { deadends: [], target: "0000" }
expected: 0
- input: { deadends: [], target: "1111" }
expected: 4
- input: { deadends: ["1111"], target: "1112" }
expected: 5
- input: { deadends: ["0001", "0010", "0100", "1000"], target: "9999" }
expected: 4
description: |
You have a lock in front of you with 4 circular wheels. Each wheel has 10 slots: `'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'`. The wheels can rotate freely and wrap around: for example we can turn `'9'` to be `'0'`, or `'0'` to be `'9'`. Each move consists of turning **one wheel one slot**.