Count Largest Group Problem

Count Largest Group Problem — ExecCode Easy DSA Practice

Solve the Count Largest Group problem on ExecCode. Free online easy DSA practice in Hashing. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given an integer n. Your task is to compute the required answer and return the number of groups that have the largest size, i.e. 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. the maximum number of elements.

Examples

Input {"n": 13}; Output 4. Input {"n": 2}; Output 2

Constraints

1 <= n <= 10^4

Practice Count Largest Group free on ExecCode. Browse DSA problems, topic map, and placement guides.