Tap here to switch tabs
Problem
Submissions

Problem: Smallest Greater Multiple Made of Two Digits

Smallest Greater Multiple Made of Two Digits gives k and two digits. Find the smallest integer greater than k that is divisible by k and uses only those digits, or return -1 if none exists.

Statement

Given three integers k, digit1, and digit2, find the smallest integer strictly greater than k that is a multiple of k and whose decimal representation consists only of the digits digit1 and digit2.

Return this integer, or return −1-1 if no such integer exists.

Constraints:

  • 1≤1 \leq k ≤1000\leq 1000

  • 0≤0 \leq digit1 ≤9\leq 9

  • 0≤0 \leq digit2 ≤9\leq 9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Smallest Greater Multiple Made of Two Digits

Smallest Greater Multiple Made of Two Digits gives k and two digits. Find the smallest integer greater than k that is divisible by k and uses only those digits, or return -1 if none exists.

Statement

Given three integers k, digit1, and digit2, find the smallest integer strictly greater than k that is a multiple of k and whose decimal representation consists only of the digits digit1 and digit2.

Return this integer, or return −1-1 if no such integer exists.

Constraints:

  • 1≤1 \leq k ≤1000\leq 1000

  • 0≤0 \leq digit1 ≤9\leq 9

  • 0≤0 \leq digit2 ≤9\leq 9