Leetcode 1492: The kth Factor of n
In this Leetcode problem, we should return the kth factor of
-1 if such factor doesn’t exist.
This is pretty much brute force:
- Test all integers from
- Count the number of factors
current = kreturn the current factor value