House Robber — Medium Coding Interview Question
Return the maximum amount of money you can rob tonight without alerting police (cannot rob adjacent houses).
Example
Input: nums = [1,2,3,1]
Output: 4
Constraints
Topics & Companies
Topics: dp
Asked by: Google, Amazon
Optimal Solution Complexity
Time complexity: O(n). Space complexity: O(1).
Practice more