feat(content): more test cases

This commit is contained in:
2025-07-13 19:25:39 +01:00
parent d2b74b6863
commit 85fea3a4bb
94 changed files with 1840 additions and 0 deletions

View File

@@ -10,6 +10,24 @@ patterns:
- backtracking
- dfs
function_signature: "def exist(board: list[list[str]], word: str) -> bool:"
test_cases:
visible:
- input: { board: [["A", "B", "C", "E"], ["S", "F", "C", "S"], ["A", "D", "E", "E"]], word: "ABCCED" }
expected: true
- input: { board: [["A", "B", "C", "E"], ["S", "F", "C", "S"], ["A", "D", "E", "E"]], word: "SEE" }
expected: true
- input: { board: [["A", "B", "C", "E"], ["S", "F", "C", "S"], ["A", "D", "E", "E"]], word: "ABCB" }
expected: false
hidden:
- input: { board: [["A"]], word: "A" }
expected: true
- input: { board: [["A", "B"], ["C", "D"]], word: "ABCD" }
expected: false
- input: { board: [["A", "B"], ["C", "D"]], word: "ABDC" }
expected: true
description: |
Given an `m × n` grid of characters `board` and a string `word`, return `true` if `word` exists in the grid.