Java easy peasy
\nclass Solution {\n    public int func(int k)\n    {\n        int temp=1;\n        for(int i=1;i<100001;i++)\n        {\n            if(temp%k==0)\n           
```\nclass Solution {\n    public int func(int k)\n    {\n        int temp=1;\n        for(int i=1;i<100001;i++)\n        {\n            if(temp%k==0)\n            {\n                return i;\n            }\n            int mod=temp%k;\n            temp=mod*10+1;\n        }\n        return -1;\n    }\n    \n    public int smallestRepunitDivByK(int K) {\n      \n        if((K & 1)==1)\n        {\n            return func(K);\n        }\n        return -1;\n        \n    }\n}\n```
[]