Python Simple Solutiom
\nclass Solution:\n     def smallestRepunitDivByK(self, K):\n        if K % 2 == 0 or K % 5 == 0:\n            return -1\n        r = 0\n        for N in range(
```\nclass Solution:\n     def smallestRepunitDivByK(self, K):\n        if K % 2 == 0 or K % 5 == 0:\n            return -1\n        r = 0\n        for N in range(1, K + 1):\n            r = (r * 10 + 1) % K\n            if r==0:\n                return N\n```
['Python', 'Python3']