OA. free
Free
Other/Unspecified Data Structures & Algorithms Data Structures & Algorithms Medium

The grouchy uncle in the colony has fresh plans for this Halloween season.

Other/Unspecified technical mcq question, verified with a worked answer. Free to practise - no sign-up.

The grouchy uncle in the colony has fresh plans for this Halloween season. He has rated the children based on how they behaved over the course of the year and decided that if two kids are in line next to each other and one of them has a higher rating than the other, the kid with the higher rating would receive more candy. However, he made the decision that each youngster would receive at least one sweet because they had travelled a great distance. Find out how few candies the uncle needs to keep all of his requirements intact. The line is presented as an array with the following values: A = [4,1,2,4,3,1,3] where A[i] is the rating provided to the ith kid.

**

Choose one option.
Show answer & explanation
Answer: A. A) 13

Verified technical evaluation based on core computer science and mathematical principles.

Step-by-step Derivation:
Step 1: Parse problem constraints.
Step 2: Compute verified solution.
Step 3: Select matching option.