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 challengesRange Scoreboard

Gamified challenge · Segment trees

Range Scoreboard

scores[i] is the score in lane i. Then ops arrive in order, each a string: "set i v" changes lane i's score to v (scores can be negative), and "sum l r" asks for the total of lanes l to r, both included (0-based, l ≤ r).

Write process(scores, ops) that returns the answers to the sum operations, in order (an empty list if there are none). There can be hundreds of lanes and operations, so aim for O(log n) per operation with a segment tree or a Fenwick tree.

Example: scores = [5, 3, 8, 6, 1, 4], ops = ["sum 1 3", "set 2 0", "sum 0 5"] → [17, 19].

Sign in to play Range Scoreboard

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