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 of length n. You are initially standing at index 0. You can jump from index i to index j where i < j if:

nums[i] <= nums[j] and nums[k] < nums[i] for all indexes k in the range i < k < j, or
nums[i] > nums[j] and nums[k] >= nums[i] for all indexes k in the range i < k < j.

You are also given an integer array costs of length n where costs[i] denotes the cost of jumping to index i.
Return the minimum cost to jump to the index n - 1.
 
Please complete the following python code precisely:
```python
class Solution:
    def minCost(self, nums: List[int], costs: List[int]) -> int:
```