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 challengesDelivery Speed Dial

Gamified challenge · Binary search on the answer

Delivery Speed Dial

piles[i] parcels wait at stop i, and the courier has h hours (always at least one hour per stop). At speed k the courier hands over up to k parcels an hour and spends each hour at one stop, even if that stop runs out early, so stop i takes ⌈piles[i] / k⌉ hours.

Write minSpeed(piles, h) that returns the smallest whole speed k ≥ 1 that delivers everything within h hours.

Example: piles = [3, 6, 7, 11], h = 8. Speed 4 takes 1 + 2 + 2 + 3 = 8 hours, but speed 3 takes 1 + 2 + 3 + 4 = 10, so the answer is 4.

Sign in to play Delivery Speed Dial

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