feat(content): function signatures + test cases
This commit is contained in:
@@ -9,6 +9,32 @@ categories:
|
||||
patterns:
|
||||
- dynamic-programming
|
||||
|
||||
function_signature: "def rob(nums: list[int]) -> int:"
|
||||
|
||||
test_cases:
|
||||
visible:
|
||||
- input: { nums: [2, 3, 2] }
|
||||
expected: 3
|
||||
- input: { nums: [1, 2, 3, 1] }
|
||||
expected: 4
|
||||
- input: { nums: [1, 2, 3] }
|
||||
expected: 3
|
||||
hidden:
|
||||
- input: { nums: [1] }
|
||||
expected: 1
|
||||
- input: { nums: [1, 2] }
|
||||
expected: 2
|
||||
- input: { nums: [0, 0, 0, 0] }
|
||||
expected: 0
|
||||
- input: { nums: [200, 3, 140, 20, 10] }
|
||||
expected: 340
|
||||
- input: { nums: [1, 3, 1, 3, 100] }
|
||||
expected: 103
|
||||
- input: { nums: [1, 1, 1, 1, 1, 1, 1] }
|
||||
expected: 3
|
||||
- input: { nums: [100, 1, 1, 100] }
|
||||
expected: 101
|
||||
|
||||
description: |
|
||||
You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at this place are **arranged in a circle**. That means the first house is the neighbour of the last one. Meanwhile, adjacent houses have a security system 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