Candy Collection

  • + 0 comments

    Can someone tell why are the example inputs separated as they are? Take the second one as example, why crate one has 3 elements (9 9 9) while crate two has 2 elements (2 2)? Take a similar example, but with candies = (9 9 9 10 2). Using the same separation of boxes like the example (which is what I dont understand), the result would be = (9 9 9) (10 2) = 9 + 10 = 19. However, since only the last color repeats, the logical separation of boxes for me would be (9 9 9 10) and (2), which is = 10 + 2 = 12.

    Am I missing something?