interview : VO round 1
Anonymous User
442

Had my 1st onsite recently and got a quetion on the tougher side I'd say.

You're working on a secure PIN generator for a system. The task was to find the smallest positive integer, greater than or equal to a given number (provided as a string), such that -None of its digits are zero, and The product of its digits is divisible by a given target t.

If no such number exists, I had to return "-1".

Example:
Input: "4567", target = 210
Output: "4575"

Here, 4×5×7×5 = 700, which is divisible by 210, and the number doesn’t contain any zeros.

Comments (5)