House Robber
PayPal interview questions · Medium · Coding round · 7 tests
You are given an integer array nums where nums[i] is the amount of
money stored in the i-th house on a street.
You want to steal the largest possible total, but there is one rule: if you rob two adjacent houses on the same night, an alarm is triggered.
Return the maximum amount of money you can rob without choosing two neighboring houses.
Run your code with Ctrl+Enter to see results.