You are given a nums containing
In each second, for every index i from nums[i] with any of the following values:
nums[i]
nums[(i - 1 + n) % n]
nums[(i + 1) % n]
Return the minimum number of seconds required to make all elements in nums equal.
Constraints:
nums.length
nums[i]
You are given a nums containing
In each second, for every index i from nums[i] with any of the following values:
nums[i]
nums[(i - 1 + n) % n]
nums[(i + 1) % n]
Return the minimum number of seconds required to make all elements in nums equal.
Constraints:
nums.length
nums[i]