You are given an integer array nums of size n containing distinct integers from
In a single operation, you can choose any element and move it to the empty space, swapping that element with
The array nums is considered sorted if the numbers from
Return the minimum number of operations needed to sort nums.
Constraints:
n == nums.length
n
nums[i] n
All the values of nums are unique.
You are given an integer array nums of size n containing distinct integers from
In a single operation, you can choose any element and move it to the empty space, swapping that element with
The array nums is considered sorted if the numbers from
Return the minimum number of operations needed to sort nums.
Constraints:
n == nums.length
n
nums[i] n
All the values of nums are unique.