c++ solution 100%
\nclass Solution {\npublic:\n    int smallestRepunitDivByK(int k) {\n        if((!(k%2))||!(k%5))return -1;\n        int r=1,l=1;\n        while(r%k){\n        
```\nclass Solution {\npublic:\n    int smallestRepunitDivByK(int k) {\n        if((!(k%2))||!(k%5))return -1;\n        int r=1,l=1;\n        while(r%k){\n            r%=k;\n            l++;\n            r=r*10+1;\n        }\n        return l;\n    }\n};\n```
[]