Case of equal ratings consecutively


In this Problem it should be mentioned that two consecutive children with same rating can have different ratings. Take example of {1,2,2,2,1} the expected solution for this is 7 but its only possible when the ‘2’ in centre gets 1 candy.


Yes, I think it should have been mentioned