← All problemsSign in

1399. Count Largest Group

LeetCodeHash TableMathCountingOpen on judge ↗

You are given an integer n. We need to group the numbers from 1 to n according to the sum of its digits. For example, the numbers 14 and 5 belong to the same group, whereas 13 and 3 belong to different groups. Return the number of groups that have the largest size, i.e. the maximum number of elements. Example 1: Input: n = 13 Output: 4 Explanation: There are 9 groups in total, they are group

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start