pub fn rob(nums: Vec<i32>) -> i32 {
// f(2) = max(nums[0], nums[1])
// f(3) = max(f(1) + nums[2], f(2))
// f(4) = max(f(2) + nums[4], f(3))
// f(n) = max(f(n-2) + nums[n], f(n-1))
// f(3) = max(1 + 3, 2) = 4
// f(4) = max(2 + 1, 4) = 4
// f(3) = max(2 + 9, 2) = 11
// f(4) = max(3 + 7, 11) = 11
// f(5) = max(1 + 11, 11) = 12
let mut arr = vec![0; nums.len()];
arr[1] = nums[0].max(nums[1]);
let a = arr[i-2] + nums[i];