K30
House Robber I
Problem Statement & Objective
You are a professional robber planning to rob houses along a street. Adjacent houses have security systems; determine the maximum money you can rob without alerting police.
Function Signature (Python)
house_robber_i(houses: list[int]) -> intInput & Output Contract
Output Rule:Maksimum para miktarı.
System Constraints
0 <= evler.length <= 100
0 <= evler[i] <= 400Example Execution Walkthrough
evler = [1, 2, 3, 1] -> 1. ev (1) + 3. ev (3) = 4
evler = [2, 7, 9, 3, 1] -> 2 + 9 + 1 = 12Example Test Scenarios (3)
Example 1
Input:
[[1,2,3,1]]Expected Output:
4Example 2
Input:
[[2,7,9,3,1]]Expected Output:
12Example 3: Boş Sokak
Input:
[[]]Expected Output:
0