1
class Solution:
2
def smallestRepunitDivByK(self, k: int) -> int:
3
if k % 2 == 0:
4
return -1
5
n = 1
6
leng = 1
7
mapp = {}
8
while True:
9
rem = n % k
10
if rem == 0:
11
return leng
12
if rem in mapp:
13
return -1
14
mapp[rem] = True
15
n = n * 10 + 1
16
leng += 1

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0