Salesforce | OA | AMTS
Anonymous User
699

Given 2 integers f and k, find the minimum integer x such that it is a multiple of f and sum of its digit is equal to k. Since the number could be very large, return it as a string.

Eg: f=2, k=1
=> x=10 (as x is the minimum integer which is divisible by f=2 and sum of its digit is equal to k=1)

Contsraints:
1<=f<=495
1<=k<=5000

Comments (1)