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

You are given two positive integers n and k. A factor of an integer n is defined as an integer i where n % i == 0.
Consider a list of all factors of n sorted in ascending order, return the kth factor in this list or return -1 if n has less than k factors.
 
Please complete the following python code precisely:
```python
class Solution:
    def kthFactor(self, n: int, k: int) -> int:
```