C++ || 0ms Solution
\nclass Solution {\npublic:\n    int smallestRepunitDivByK(int k) {\n        \n        if(k % 2 == 0 || k%5 == 0)\n            return -1;\n        \n        int
```\nclass Solution {\npublic:\n    int smallestRepunitDivByK(int k) {\n        \n        if(k % 2 == 0 || k%5 == 0)\n            return -1;\n        \n        int num = 0;\n        int count  = 0;\n        \n        while(count<k)\n        {\n            count++;\n            \n            num = (num * 10 + 1)%k;\n            //cout<<num<<endl;\n            if(num%k == 0)\n                return count;\n        }\n        \n        return -1;\n    }\n};\n```
['C']