Maximum Number of Balls in a Box LeetCode solution in Python
1class Solution:2def countBalls(self, lowLimit: int, highLimit: int) -> int:3boxes = [0] * 10045for i in range(lowLimit, highLimit + 1):67# For the current number "i", convert it into a list of its digits.8# Compute its sum and increment the count in the frequency table.910boxes[sum([int(j) for j in str(i)])] += 11112return max(boxes)