Search
⌘K

Leetcode 135. Candy

Given a line of children with integer ratings, assign each at least one candy so any child with a higher rating than a neighbor gets more candies, and compute the minimum total required; the core challenge is balancing local increases/decreases across the array (typically handled by scanning increasing/decreasing runs or a two-pass greedy) in linear time.

Asked at:

PayPal

M

Marvin


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Early December, 2025

M

Marvin

Mid-level

Late October, 2025

PayPal

Staff

Comments

Your account is free and you can post anonymously if you choose.