<p>You are working in a ball factory where you have <code>n</code> balls numbered from <code>lowLimit</code> up to <code>highLimit</code> <strong>inclusive</strong> (i.e., <code>n == highLimit - lowLimit + 1</code>), and an infinite number of boxes numbered from <code>1</code> to <code>infinity</code>.</p>

<p>Your job at this factory is to put each ball in the box with a number equal to the sum of digits of the ball&#39;s number. For example, the ball number <code>321</code> will be put in the box number <code>3 + 2 + 1 = 6</code> and the ball number <code>10</code> will be put in the box number <code>1 + 0 = 1</code>.</p>

<p>Given two integers <code>lowLimit</code> and <code>highLimit</code>, return<em> the number of balls in the box with the most balls.</em></p>

<p>&nbsp;</p>
<p><strong class="example">Example 1:</strong></p>

<pre>
<strong>Input:</strong> lowLimit = 1, highLimit = 10
<strong>Output:</strong> 2
<strong>Explanation:</strong>
Box Number:  1 2 3 4 5 6 7 8 9 10 11 ...
Ball Count:  2 1 1 1 1 1 1 1 1 0  0  ...
Box 1 has the most number of balls with 2 balls.</pre>

<p><strong class="example">Example 2:</strong></p>

<pre>
<strong>Input:</strong> lowLimit = 5, highLimit = 15
<strong>Output:</strong> 2
<strong>Explanation:</strong>
Box Number:  1 2 3 4 5 6 7 8 9 10 11 ...
Ball Count:  1 1 1 1 2 2 1 1 1 0  0  ...
Boxes 5 and 6 have the most number of balls with 2 balls in each.
</pre>

<p><strong class="example">Example 3:</strong></p>

<pre>
<strong>Input:</strong> lowLimit = 19, highLimit = 28
<strong>Output:</strong> 2
<strong>Explanation:</strong>
Box Number:  1 2 3 4 5 6 7 8 9 10 11 12 ...
Ball Count:  0 1 1 1 1 1 1 1 1 2  0  0  ...
Box 10 has the most number of balls with 2 balls.
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

<ul>
	<li><code>1 &lt;= lowLimit &lt;= highLimit &lt;= 10<sup>5</sup></code></li>
</ul>

class Solution:
    def countBalls(self,lowLimit: int, highLimit: int) -> int:
        ball_Count = [0,] * 100
        temp_value = 0

        for i in range(lowLimit,highLimit+1) :
            if i >= 10 :
                str_value = str(i)
                for i in str_value :
                    temp_value += int(i)
                
                ball_Count[temp_value] += 1
                temp_value = 0
                
            else :
                ball_Count[i] += 1

        return max(ball_Count)

                















        # box_array = [0] * 100
        # tan_value = 0 
        
        # for i in range(lowLimit,highLimit+1) :
        #     num_str = str(i) # 28
        #     for i in num_str :
        #         print(i)
        #         tan_value += int(i)
            
        #     box_array[tan_value] +=1
            
        #     tan_value = 0 

        # return max(box_array)
            



        # case 1        
        # 공이 1~10이라는거니까...  상자는 무한개고 
        # 1번 2   2번 1   3번 1 # 4번 1 # 5번 1 # 6번 1 # 7번 1 # 8번 1 # 9번 1 # 10번 0
        # 11번 0

        # case 2  5~15
        # 1 1 1 1 2 2 1 1 1

        # case 3 19~28
        # 0 1 1 1 1 1 1 1 1 2



        


        
16400