Tap here to switch tabs
Problem
Submissions

Problem: Minimum Moves to Equal Array Elements III

Minimum Moves to Equal Array Elements III asks you to find the fewest moves to make every value in an integer array equal, with each move incrementing one chosen element by one.

Statement

Given an integer array nums, return the minimum number of moves required to make all elements in nums equal.

In one move, you can increment any single element of the array by 11.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i] ≤100\leq 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Minimum Moves to Equal Array Elements III

Minimum Moves to Equal Array Elements III asks you to find the fewest moves to make every value in an integer array equal, with each move incrementing one chosen element by one.

Statement

Given an integer array nums, return the minimum number of moves required to make all elements in nums equal.

In one move, you can increment any single element of the array by 11.

Constraints:

  • 1≤1 \leq nums.length ≤100\leq 100

  • 1≤1 \leq nums[i] ≤100\leq 100