feat(content): function signatures + test cases
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user