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 challengesGold Mine Ledger

Gamified challenge · Prefix sums

Gold Mine Ledger

mines[k] is the gold in mine k along the valley. Each query [i, j] in queries asks how much gold lies in mines i to j, both included (0-based, i <= j).

Write rangeGold(mines, queries) (range_gold in Python) that returns one total per query, in the same order. There can be many queries, so build a running total once instead of re-adding every range.

For mines = [3, 1, 4, 1, 5, 9, 2, 6] and queries = [[0, 3], [2, 5], [4, 4]] the answer is [9, 19, 5].

Sign in to play Gold Mine Ledger

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