You are given two positive integers n and k.
A factor of n is defined as an integer i such that n % i == 0.
Return the kth factor of n (in ascending order).
If n has fewer than k factors, return -1.
Input: n = 12 k = 3
Output: 3
Input: n = 7 k = 2
Output: 7
Accepted:
Submission: