C++ easy solution
class Solution {\n# public:\n    int smallestRepunitDivByK(int k) {\n      if(k%2==0 ||k%5==0){\n          return -1;\n      } \n      unordered_mapm;\n        
class Solution {\n# public:\n    int smallestRepunitDivByK(int k) {\n      if(k%2==0 ||k%5==0){\n          return -1;\n      } \n      unordered_map<int,int>m;\n        m[1]++;\n        int x=1;\n        while(x<k){\n            x*=10;\n            m[1]++;\n            x++;\n        }\n        while(x!=0){\n            x-=k;\n            while(x!=0 && x<k){\n                x*=10;\n                m[1]++;\n                x++; \n            }\n        }\n        return m[1];\n    }\n};
['Math']