Search⌘ K
AI Features

Candy

Candy distributes at least one candy to every child in a line, with higher-rated children receiving more than adjacent neighbors. Find the minimum total.

Statement

You are given an array, ratings, where ratings[i] represents the rating of the ...