class Solution:
    def minIncrementForUnique(self, A: List[int]) -> int:
        #Sol1 sort & find cur_num faster than 90%
        NUM,ans = 80000,0
        A.sort()
        cur_num = -1
        for i, num in enumerate(A):
            if num <= cur_num:
                cur_num += 1
                ans += cur_num - num
                
            else:
                cur_num = num
        return ans
        
        '''
        Sol2 hashmap TLE
        m = [False] * NUM
        for num in A:
            for j in range(num, NUM):
                if m[j]==False:
                    m[j] = True
                    ans += j - num
                    break
        '''
        
        return ans

d25a8c8909f3952c165ceaaf035bf991a1d957e9
<mask token>

class Solution:
    <mask token>

class Solution:

    def minIncrementForUnique(self, A: List[int]) ->int:
        NUM, ans = 80000, 0
        A.sort()
        cur_num = -1
        for i, num in enumerate(A):
            if num <= cur_num:
                cur_num += 1
                ans += cur_num - num
            else:
                cur_num = num
        return ans
        """
        Sol2 hashmap TLE
        m = [False] * NUM
        for num in A:
            for j in range(num, NUM):
                if m[j]==False:
                    m[j] = True
                    ans += j - num
                    break
        """
        return ans

class Solution:
    def minIncrementForUnique(self, A: List[int]) -> int:
        #Sol1 sort & find cur_num faster than 90%
        NUM,ans = 80000,0
        A.sort()
        cur_num = -1
        for i, num in enumerate(A):
            if num <= cur_num:
                cur_num += 1
                ans += cur_num - num
                
            else:
                cur_num = num
        return ans
        
        '''
        Sol2 hashmap TLE
        m = [False] * NUM
        for num in A:
            for j in range(num, NUM):
                if m[j]==False:
                    m[j] = True
                    ans += j - num
                    break
        '''
        
        return ans
