Sweetest Candy
Chef wants to buy candy for his friend. He went to a store which sells candies from $N$ jars, arranged in a circle and numbered $1$ through $N$ in such a way that for each valid $i$, jars $i$ and $i+1$ are adjacent, and jars $1$ and $N$ are also adjacent. For each valid $i$, the candies in the $i$-th jar have a sweetness $A_i$. Obviously, Chef wants to buy the sweetest candies. However, he gets
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start