You are viewing a single comment's thread. Return to all comments →
I don't quite understand this line in the second half of your code:
(markings[i] > markings[i+1] && (markings[i+1] + 1) > markings[i])
this logically translates to "markings[i] > markings[i+1] && markings[i] <= markings[i+1]", which will always evaluate to false...and thus candies[i] will be assigned to candies[i] every time...so how exactly will this still work as intended?