Skip to content

Commit d9a1ebe

Browse files
committed
Fix demo function by adding missing arguments and correcting syntax errors in test cases
1 parent 84ce334 commit d9a1ebe

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/interview_workbook/leetcode/sliding_window/subarray_product_less_than_k.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def solve(self, *args):
2828

2929
def demo():
3030
"""Run a simple demonstration for Subarray Product Less Than K."""
31-
nums =
31+
nums = [10, 5, 2, 6]
3232
k = 100
3333
result = Solution().solve(nums, k)
3434
return f"Input: nums={nums}, k={k} -> Count of subarrays: {result}"

tests/test_leetcode_car_fleet.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@ class TestSolution:
1010
def test_example_cases(self):
1111
"""Test with provided examples."""
1212
solution = Solution()
13-
assert solution.solve(12,,) == 3
14-
assert solution.solve(10,,) == 1
15-
assert solution.solve(100,,) == 1
13+
assert solution.solve(12, [10, 8, 0, 5, 3], [2, 4, 1, 1, 3]) == 3
14+
assert solution.solve(10, [3], [3]) == 1
15+
assert solution.solve(100, [0, 2, 4], [4, 2, 1]) == 1
1616

1717
def test_edge_cases(self):
1818
"""Test edge cases."""
1919
solution = Solution()
2020
assert solution.solve(10, [], []) == 0
21-
assert solution.solve(20,,) == 3
22-
assert solution.solve(10,,) == 1
21+
assert solution.solve(20, [6, 2, 12], [3, 1, 3]) == 3
22+
assert solution.solve(10, [6, 8], [3, 2]) == 1
2323

2424
def test_large_input(self):
2525
"""Test with larger inputs."""

0 commit comments

Comments
 (0)