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\)
Submissions
Please login to view your submissions
Similar Problems
Editorial