GamifiedGamified challengesPracticeRaceLeaderboardPricing

Learn data structures by watching them move, then doing it yourself. Press M anytime to toggle sound.

A product of Amypo Technologies, Coimbatore.

Learn

  • All topics
  • Learning path
  • How it works
  • About dotprep

Practice

  • Practice arena
  • Daily challenge
  • Gamified challenges
  • Race mode
  • Leaderboard

Interview prep

  • Java interview
  • Coding questions
  • Company questions
  • System design
  • Jobs & careers

You

  • Dashboard
  • Settings
  • Pricing
  • Create account

© 2026 dotprep

Content last updated 20 November 2026

GamifiedGamified challengesPracticeRaceLeaderboardPricing
Log inStart free
Gamified challengesStreet Heist

Gamified challenge · Dynamic programming

Street Heist

houses[i] is the loot inside house i along a street. You may rob any set of houses, but never two next to each other: neighbours share an alarm.

Write maxLoot(houses) (Python: max_loot) that returns the most loot you can take. For [2, 7, 9, 3, 1] the answer is 12 (houses 0, 2 and 4). For [2, 1, 1, 2] it is 4: rob houses 0 and 3.

An empty street gives 0. Loot values are between 0 and 400 and there are at most 100 houses.

Sign in to play Street Heist

This game is part of the paid plans. Sign in, then pick a plan to write your answer, watch it play out, and step through the algorithm with its guide.

Sign in with Google

or log in with email · create an account