Candy Rounds — Solution & Editorial
One full circle costs N(N+1)/2 candies — skip whole circles with division, then simulate the final partial circle.
Complexity: O(N) after skipping full rounds
One full circle costs N(N+1)/2 candies — skip whole circles with division, then simulate the final partial circle.
Complexity: O(N) after skipping full rounds