Tap here to switch tabs
Problem
Submissions

Problem: Minimum Increment to Make Array Unique

med
30 min
Try to solve the Minimum Increment to Make Array Unique problem.

Statement

Given an integer array nums, you may perform the following operation any number of times: choose an index i and increase nums[i] by 11.

Return the minimum number of operations required to make every value in nums distinct.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 0≤0 \leq nums[i] ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Increment to Make Array Unique

med
30 min
Try to solve the Minimum Increment to Make Array Unique problem.

Statement

Given an integer array nums, you may perform the following operation any number of times: choose an index i and increase nums[i] by 11.

Return the minimum number of operations required to make every value in nums distinct.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 0≤0 \leq nums[i] ≤105\leq 10^5