top are split into groups: two numbers share a group when their digits add up to the same value. For example, 4, 13 and 22 end up together.
Find the size of the largest group and return how many groups have exactly that size.top=15 → 6
The groups with digit sums 1 to 6 each hold two numbers (such as 3 and 12, or 6 and 15), while groups 7, 8 and 9 hold one. There are 6 largest groups.
top=3 → 3
Three groups of one number each: [1], [2], [3]. All of them are the largest.
top=20 → 1
The group with digit sum 2 holds three numbers, 2, 11 and 20, and every other group is smaller. There is one largest group.
top ≤ 10⁴top=15
6
Run checks the first 3 tests in your browser. Submit checks all 48 tests on the server, hidden ones included.