Click here to see the full article post
Inside of the for loop why not added by 1: candies += count(up) + count(down) + Math.max(up, down);
@ArthurTang Fixed. Thanks.
Why same rating got different candies? In Approach #2, "...34,34..." ratings got "...1,2..." candies, it's unreasonable! Hope to correct the problem.
Will an interviewer really expect someone to come up with the slope based solution during an interview?
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.