C++ Simplest and Shortest Solution, 0 ms faster than 100%
\nclass Solution {\npublic:\n    int smallestRepunitDivByK(int K) {\n        if (K % 2 == 0) // Always false when K is even\n            return -1;\n        \n 
```\nclass Solution {\npublic:\n    int smallestRepunitDivByK(int K) {\n        if (K % 2 == 0) // Always false when K is even\n            return -1;\n        \n        int num = 1, res = 1;\n        \n        while (num % K) {\n            num = (num * 10 + 1) % K;\n            res++;\n            if (res > K)\n                return -1;\n        }\n        return res;\n    }\n};\n```\n**Like it? please upvote...**
['C']