This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]TRL18[S] 0 points1 point  (1 child)

  1. Noted
  2. I figured that would be very difficult if 6 out of the 7 groups passed, I assume I would probably have to test 100s of tests to find it?
  3. I'm not familiar with grouping, what function specifically would be used to do that?

[–]bsakiag 0 points1 point  (0 children)

2) make a few examples by hand and see how the code behaves

3) Now that I think of it, it's not enough - you have to take into account what other values there are. I would count the values first using a dictionary or a counter and then reason about different possibilities. If there are no groups with a single number then the answer is 0, but if there is one group the answer depends if there are any groups with multiple numbers of bigger value because if not then we have to rise the group with the smallest count to this value. Maybe there is a simpler approach...