Please solve the programming task below using a self-contained code snippet in a markdown code block.

You are given a 0-indexed array nums containing n integers.
At each second, you perform the following operation on the array:

For every index i in the range [0, n - 1], replace nums[i] with either nums[i], nums[(i - 1 + n) % n], or nums[(i + 1) % n].

Note that all the elements get replaced simultaneously.
Return the minimum number of seconds needed to make all elements in the array nums equal.
 
Please complete the following python code precisely:
```python
class Solution:
    def minimumSeconds(self, nums: List[int]) -> int:
```