feat(content): more test cases
This commit is contained in:
@@ -9,6 +9,24 @@ categories:
|
||||
patterns:
|
||||
- dynamic-programming
|
||||
|
||||
function_signature: "def rob(nums: list[int]) -> int:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { nums: [1, 2, 3, 1] }
|
||||
expected: 4
|
||||
- input: { nums: [2, 7, 9, 3, 1] }
|
||||
expected: 12
|
||||
hidden:
|
||||
- input: { nums: [1] }
|
||||
expected: 1
|
||||
- input: { nums: [2, 1] }
|
||||
expected: 2
|
||||
- input: { nums: [1, 2, 3, 4, 5] }
|
||||
expected: 9
|
||||
- input: { nums: [0, 0, 0, 0] }
|
||||
expected: 0
|
||||
|
||||
description: |
|
||||
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security systems connected and **it will automatically contact the police if two adjacent houses were broken into on the same night**.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user