← Flipkart questions

Maximize stolen value from houses (House Robber / Knapsack variant)

Filed under Flipkart

Given an array representing values at each house, find the maximum amount you can rob tonight without alerting the police (no two adjacent houses can be robbed). Optimize space complexity to O(1).

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Flipkart questions

Collected from public candidate posts and coding forums. Updated Nov 2026.