Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 171f327

Browse files
Create 1492.py
1 parent a969646 commit 171f327

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎1001-1500/1492.py‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution:
2+
def kthFactor(self, n: int, k: int) -> int:
3+
i = 1
4+
while k>0:
5+
if i>n:
6+
return -1
7+
if n%i==0:
8+
k-=1
9+
i+=1
10+
return i-1

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /