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

@@ -8,6 +8,24 @@ categories:
patterns:
- matrix-traversal
function_signature: "def check_move(board: list[list[str]], r_move: int, c_move: int, color: str) -> bool:"
test_cases:
visible:
- input: { board: [[".", ".", ".", "B", ".", ".", ".", "."], [".", ".", ".", "W", ".", ".", ".", "."], [".", ".", ".", "W", ".", ".", ".", "."], [".", ".", ".", "W", ".", ".", ".", "."], ["W", "B", "B", ".", "W", "W", "W", "B"], [".", ".", ".", "B", ".", ".", ".", "."], [".", ".", ".", "B", ".", ".", ".", "."], [".", ".", ".", "W", ".", ".", ".", "."]], r_move: 4, c_move: 3, color: "B" }
expected: true
- input: { board: [[".", ".", ".", ".", ".", ".", ".", "."], [".", "B", ".", ".", "W", ".", ".", "."], [".", ".", "W", ".", ".", ".", ".", "."], [".", ".", ".", "W", "B", ".", ".", "."], [".", ".", ".", ".", ".", ".", ".", "."], [".", ".", ".", ".", "B", "W", ".", "."], [".", ".", ".", ".", ".", ".", "W", "."], [".", ".", ".", ".", ".", ".", ".", "B"]], r_move: 4, c_move: 4, color: "W" }
expected: false
hidden:
- input: { board: [[".", ".", "."], [".", "W", "."], [".", ".", "."]], r_move: 0, c_move: 1, color: "B" }
expected: false
- input: { board: [["B", "W", "."], [".", ".", "."], [".", ".", "."]], r_move: 0, c_move: 2, color: "B" }
expected: true
- input: { board: [[".", "W", "B"], [".", "W", "."], [".", ".", "."]], r_move: 2, c_move: 1, color: "B" }
expected: true
- input: { board: [["B", ".", "."], [".", "W", "."], [".", ".", "."]], r_move: 2, c_move: 2, color: "B" }
expected: true
description: |
You are given a **0-indexed** `8 x 8` grid `board`, where `board[r][c]` represents the cell `(r, c)` on a game board. On the board, free cells are represented by `'.'`, white cells are represented by `'W'`, and black cells are represented by `'B'`.