Back to problems

Maximum Number of Balls in a Box

Algorithm · Roblox · Easy

You work at a facility that labels n balls with every integer from lowLimit through highLimit, inclusive, so n == highLimit - lowLimit + 1. There is an unlimited collection of boxes, numbered starting at 1 and continuing forever. Place each ball into the box identified by the sum of the decimal digits in its label. For instance, ball 412 belongs in box 4 + 1 + 2 = 7, while ball 20 belongs in box 2 + 0 = 2. Given the integers lowLimit and highLimit, determine how many balls…

Checking your access…