122: House robber
You are a house robber and plan to rob houses on the same street, in each house there is a certain amount of money. The only constraint stopping you from robbing all of them is that adjacent houses have connected security system and it will automatically contact the police if two adjacent houses were broken at the same night.
Given an array of non-negative integers representing the amount of money of each house, return the maximum amount of money you can rob tonight without alerting the police
Example 1
Input: [2, 2, 1, 2]
Output: 4
Example 2
Input: [2, 2, 1, 2, 2]
Output: 5