javascript 240ms
\nconst smallestRepunitDivByK = (k) => {\n    let remain = 0;\n    for (let i = 1; i < 1e6; i++) {\n        remain = (remain * 10 + 1) % k;\n        if (remain 
```\nconst smallestRepunitDivByK = (k) => {\n    let remain = 0;\n    for (let i = 1; i < 1e6; i++) {\n        remain = (remain * 10 + 1) % k;\n        if (remain == 0) return i;\n    }\n    return -1;\n};\n```
['JavaScript']