Not So Simple
Practice
0 (0 votes)
Basic programming
Easy
Problem
60% Success 165 Attempts 20 Points 0.2s Time Limit 256MB Memory 1024 KB Max Code
This time your task is simple.
Given two integers X and K, find the largest number that can be formed by changing digits at atmost K places in the number X.
Note: Solve this using Numbers only not string.
Input:
First line of the input contains two integers X and K separated by a single space.
Output:
Print the largest number formed in a single line.
Constraints:
\(1 \le X \le 10^{18}\)
\(0 ≤ K ≤9\)
Sample Input
4483 2
Sample Output
9983
Code Editor
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Submissions
Please login to view your submissions
Similar Problems
Points:20
5 votes
Tags:
MathematicsOpenEasyMathematicsMathamatics
Points:20
1 votes
Tags:
Easy
Points:20
3 votes
Editorial
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor