
Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
The factors of n will be always in the range [1, n].
Keep a list of all factors sorted. Loop i from 1 to n and add i if n % i == 0. Return the kth factor if it exist in this list.