feat(content): function signatures + test cases

This commit is contained in:
2025-07-13 19:53:34 +01:00
parent d65ccf7dc2
commit 0262ca8bf6
203 changed files with 4526 additions and 0 deletions

View File

@@ -9,6 +9,26 @@ categories:
patterns:
- two-pointers
function_signature: "def check_straight_line(coordinates: list[list[int]]) -> bool:"
test_cases:
visible:
- input: { coordinates: [[1, 2], [2, 3], [3, 4], [4, 5], [5, 6], [6, 7]] }
expected: true
- input: { coordinates: [[1, 1], [2, 2], [3, 4], [4, 5], [5, 6], [7, 7]] }
expected: false
hidden:
- input: { coordinates: [[0, 0], [1, 1]] }
expected: true
- input: { coordinates: [[0, 0], [0, 1], [0, 2]] }
expected: true
- input: { coordinates: [[1, 0], [2, 0], [3, 0]] }
expected: true
- input: { coordinates: [[1, 1], [2, 2], [3, 3], [4, 4], [5, 5]] }
expected: true
- input: { coordinates: [[0, 0], [1, 1], [2, 3]] }
expected: false
description: |
You are given an array `coordinates`, where `coordinates[i] = [x, y]` represents the coordinate of a point. Check if these points make a straight line in the XY plane.