Y, I want to find a closest larger number to Y, which is obtained by deleting zero or more digits from X, by" /> Y, I want to find a closest larger number to Y, which is obtained by deleting zero or more digits from X, by" /> Y, I want to find a closest larger number to Y, which is obtained by deleting zero or more digits from X, by"/>

Largest number closest to Y

30 views Asked by At

I have two integers "X" and "Y" where X > Y, I want to find a closest larger number to Y, which is obtained by deleting zero or more digits from X, by keeping the order of digits intact.

for example: X = 4186 and Y = 11. Here by deleting 4 and 8, we left with 16, which is closest larger number to Y i.e., 11.

Can anyone help me to get the problem approach to solve?

0

There are 0 answers