diff --git a/src/my_project/interviews/amazon_high_frequency_23/round_7/the_kth_factor.py b/src/my_project/interviews/amazon_high_frequency_23/round_7/the_kth_factor.py new file mode 100644 index 00000000..a0e8dc24 --- /dev/null +++ b/src/my_project/interviews/amazon_high_frequency_23/round_7/the_kth_factor.py @@ -0,0 +1,17 @@ +class Solution: + def kthFactor(self, n, k): + """ + :type n: int + :type k: int + :rtype: int + """ + + for i in range(1, n+1): + + if n % i == 0: + k -= 1 + + if k == 0: + return i + + return -1 \ No newline at end of file