Bob is preparing for the Maths Olympiad and came across a problem in which Bob needs your help!
You are given a number in the form of a string which has missing digits, denoted by . You've to compute and output the largest number one can get after replacing both , such that the number is divisible by but not by .
Example
Assumption:
=
Approach:
We can replace the first by and the second by to get as our answer.
It should also be noticed that the largest number divisible by after replacing the is , but since it was divisible by , therefore our answer is .
Function description
Complete the function largestNumber provided in the editor. This function takes the following parameter and returns the required answer:
: the number in the form of a string.
Input format
Note: This is the input format that you must use to provide custom input (available above the Compile and Test button).
The first and only line of the input contains a string .
Output format
The only line of the output should contain the largest number that can be made after replacing both the , which is divisble by but not by .
Note: The number should be a positive number and should not contain any leading zeros.
Constraints
In the sample test case of , we can replace the first with and the second one with a to get the largest number divisible by but not by , as .