Search
⌘K
Get Premium
Leetcode 1999. Smallest Greater Multiple Made of Two Digits
Given an integer N and two decimal digits a and b, find the smallest integer strictly greater than N that is a multiple of N and whose decimal representation contains only the digits a and b. The main challenge is exploring a huge space of candidate numbers efficiently using modular arithmetic (searching over remainders, e.g., BFS on states) rather than constructing large integers directly.
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.