You are a professional thief planning to rob houses along a street. Each house has a certain amount of money stashed. All houses at each location have the same amount of money stashed. The only constraint stopping you from robbing houses on the same street is that you can't rob two consecutive houses.
Given a list of non-negative integers, representing the amount of money in each house, determine the maximum amount of money you can rob tonight.
A list of non-negative integers representing the amount of money in each house.
The maximum amount of money that can be robbed.
The solution should have a time complexity that scales linearly with the number of houses.
The solution should have a space complexity that is optimal and does not use more space than necessary.
Input: {"input_data":[1,2,3]} Output: [1,2,3]
Solve problems, verify your skills, and earn XP.