Difficulty: Medium | Category: Dynamic Programming | Asked at: Google, Meta, Amazon | Platform: Unfoldd Arena
Solve House Robber II online for free in Python, JavaScript, Java, C++, TypeScript, Go, Rust, PHP, Swift, Kotlin, Dart, Ruby, C, and C#. Practice Medium level coding interview problems with instant test case evaluation and AI-powered analysis.
Keywords: House Robber II solution, House Robber II leetcode, House Robber II python, House Robber II javascript,House Robber II java, House Robber II approach, how to solve House Robber II, medium coding problems, Dynamic Programming problems, coding interview preparation, DSA practice free.
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.