Free written solution

Count Largest Group (LeetCode 1399): Solution and Explanation

Group the numbers 1 to n by the sum of their digits and return how many groups are tied for the largest size.

Read the intuition, approach, code and complexity →