题目描述:
给定一个正整数K(1<=K<=1e5),找一个最小整数M(全由1构成,例如1,11,111,11111),使得该整数能被K整除
求最小正整数M
原题链接:https://leetcode.com/problems/smallest-integer-divisible-by-k/
示例-example:
Example 1:
Input: 1 Output: 1 Explanation: The smallest answer is N = 1, which has length 1.
Example 2:
Input: 2 Output: -1 Explanation: There is no such positive integer N divisible by 2.
Example 3:
Input: 3 Output: 3 Explanation: The smallest answer is N = 111, which has length 3.