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\)

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

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
Points:20
11 votes
Tags:
Easy
Points:20
Tags:
EasyMath