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

You are given a 0-indexed permutation of n integers nums.
A permutation is called semi-ordered if the first number equals 1 and the last number equals n. You can perform the below operation as many times as you want until you make nums a semi-ordered permutation:

Pick two adjacent elements in nums, then swap them.

Return the minimum number of operations to make nums a semi-ordered permutation.
A permutation is a sequence of integers from 1 to n of length n containing each number exactly once.
 
Please complete the following python code precisely:
```python
class Solution:
    def semiOrderedPermutation(self, nums: List[int]) -> int:
```