C++ Easy and simple solution
Guy\'s if you find this solution helpful \uD83D\uDE0A, PLEASE do UPVOTE. By doing that it motivate\'s me to create more better post like this \u270D\uFE0F\n# Co
***Guy\'s if you find this solution helpful \uD83D\uDE0A, PLEASE do UPVOTE. By doing that it motivate\'s me to create more better post like this \u270D\uFE0F***\n# Complexity\n- Time complexity:\no(n)\n\n- Space complexity:\no(1)\n\n# Code\n```\nclass Solution {\npublic:\n    int smallestRepunitDivByK(int k) {\n        int count=1;\n        if(k%2==0|| k%5==0) return -1;\n        if(k==1)return 1;\n        int ans=1;\n        int rem=1;\n        while(rem!=0){\n            ans=rem*10+1;\n            rem=ans%k;\n            count++;\n        }\n        return count;\n    }\n};\n\n```\n***Guy\'s if you find this solution helpful \uD83D\uDE0A, PLEASE do UPVOTE. By doing that it motivate\'s me to create more better post like this \u270D\uFE0F***
['Hash Table', 'C++']