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

You are given a 0-indexed integer array nums.
Swaps of adjacent elements are able to be performed on nums.
A valid array meets the following conditions:

The largest element (any of the largest elements if there are multiple) is at the rightmost position in the array.
The smallest element (any of the smallest elements if there are multiple) is at the leftmost position in the array.

Return the minimum swaps required to make nums a valid array.
 
Please complete the following python code precisely:
```python
class Solution:
    def minimumSwaps(self, nums: List[int]) -> int:
```