Tap here to switch tabs
Problem
Submissions

Problem: Maximum Number of Balls in a Box

med
30 min
Try to solve the Maximum Number of Balls in a Box problem.

Statement

Given two integers lowLimit and highLimit, there are balls numbered from lowLimit to highLimit inclusive. There are also infinitely many numbered boxes.

Each ball is placed into the box whose number equals the sum of the digits of the ball’s number.

Return the maximum number of balls contained in any single box.

Constraints:

  • 1≤lowLimit≤highLimit≤1051 \le lowLimit \le {highLimit} \le 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Number of Balls in a Box

med
30 min
Try to solve the Maximum Number of Balls in a Box problem.

Statement

Given two integers lowLimit and highLimit, there are balls numbered from lowLimit to highLimit inclusive. There are also infinitely many numbered boxes.

Each ball is placed into the box whose number equals the sum of the digits of the ball’s number.

Return the maximum number of balls contained in any single box.

Constraints:

  • 1≤lowLimit≤highLimit≤1051 \le lowLimit \le {highLimit} \le 10^5