Why the AC program give answer 10 in test example[ 3,2,1,1,4,3,3 ], how to give candies?


  • 1
    C

    why the AC program give answer 10 in test example[ 3,2,1,1,4,3,3 ], how to give candies?


  • 0
    M

    Rating: 3,2,1,1,4,3,3

    Candy: 3,2,1,1,2,1,1

    3+2+1+1+2+1+1 = 11.

    Are you certain that was the example and expected value?


  • 0
    C

    I check my code again,I found it is my fault.I lost one statement in my code.Thank you for your answer very much!


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.