Tap here to switch tabs
Problem
Submissions

Problem: Minimum Increment to Make Array Unique

Minimum Increment to Make Array Unique asks you to increase duplicate array values by one at a time until all values differ, then return the fewest operations used.

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

Minimum Increment to Make Array Unique asks you to increase duplicate array values by one at a time until all values differ, then return the fewest operations used.

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