c++ solution
\nclass Solution {\npublic:\n    int smallestRepunitDivByK(int K)\n    {\n        long long  sum=1;\n        for(int i=1;i<=K;i++)\n        {\n            if(su
```\nclass Solution {\npublic:\n    int smallestRepunitDivByK(int K)\n    {\n        long long  sum=1;\n        for(int i=1;i<=K;i++)\n        {\n            if(sum%K==0)\n            {\n                return i;\n            }\n            sum=(sum*10+1)%K;\n        }\n        return -1;\n    }\n};\n```
['Math', 'C', 'C++']