Digit Problem
Practice
3.9 (280 votes)
Approved
Basic programming
Easy
Problem
81% Success 67293 Attempts 10 Points 1s 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.

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 \le K \le 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:10
20 votes
Tags:
Basic ProgrammingC++
Points:10
29 votes
Tags:
Basic ProgrammingC++
Points:10
79 votes
Tags:
Basic Programming