Tap here to switch tabs
Problem
Submissions

Problem: Smallest All-Ones Multiple

Try to solve the Smallest All-Ones Multiple problem.

Statement

Given a positive integer k, find the length of the smallest positive integer n such that n is divisible by k, and n contains only the digit 11 in its decimal representation.

Return the length of n. If no such integer n exists, return −1-1.

Constraints:

  • 2≤2 \leq k ≤105\leq 10^5

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Smallest All-Ones Multiple

Try to solve the Smallest All-Ones Multiple problem.

Statement

Given a positive integer k, find the length of the smallest positive integer n such that n is divisible by k, and n contains only the digit 11 in its decimal representation.

Return the length of n. If no such integer n exists, return −1-1.

Constraints:

  • 2≤2 \leq k ≤105\leq 10^5