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 challengesCoin Collector

Gamified challenge · Grid DP

Coin Collector

A field is scattered with coins. You start on the top-left cell and must reach the bottom-right one, moving only right or down. coins[r][c] is the number of coins on a cell, or -1 for a rock you can't step on. The start and finish are never rocks, and a path always exists.

Write bestPath(coins) (best_path in Python) that returns your moves as a string of R and D collecting the most coins (the start and finish cells count). For [[1, 3, 1], [1, -1, 1], [4, 2, 1]] that's "DDRR", which collects 9.

Sign in to play Coin Collector

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