Search⌘ K
AI Features

Solution: The kth Factor of n

Let's solve the The kth Factor of n problem using the Math and Geometry pattern.

Statement

Given two positive integers, n and k, a factor of n is any positive integer i such that n % i == 0.

Construct a list of all factors of n in ascending order and return the kthkth factor in this list. If n has fewer than k factors, return 1-1.

Constraints:

  • 11 \leq k ...