solulubeta
Sign in
Story Problems / Greedy
06.05 · Problem

Candies for the Class

Hard Two passes (left→right, right→left) Pro

This problem is part of solulu Pro

A teacher stands children in a line, each with a rating. She gives every child at least one candy, and any child with a higher rating than a neighbour must get more candies than that neighbour. What is the minimum total…

Lifetime ₹2,000 ₹1,000 · Beta offer
Mark this problem as solved when you are finished.

Item 59 of 94 · updated 2026-10-12