feat(content): more test cases

This commit is contained in:
2025-07-13 19:25:39 +01:00
parent d2b74b6863
commit 85fea3a4bb
94 changed files with 1840 additions and 0 deletions

View File

@@ -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**.