Largest Number
Practice
2.3 (20 votes)
Basic programming
C++
Problem
81% Success 5331 Attempts 10 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Given an integer \(N\) which has \(D\) digits. You have to delete exactly \(K\) digits in integer \(N\).

Find out the largest possible number which can be built from \(N\) after removing exactly \(K\) digits.

Input Format:

  • First line contains two space separated integers \(N\) \(K\).

Output Format:

Print the largest possible number which can be built from \(N\) after removing exactly \(K\) digits.

Constraints:

\(1 \le N \le 10^{18} \\ 1 \le K \le 3 \\ K \le D\)

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 ProgrammingBasic MathAlgorithmsNumber theory
Points:10
82 votes
Tags:
Basic ProgrammingEasy
Points:10
39 votes
Tags:
ImplementationBasic ProgrammingSortingBasics of Greedy AlgorithmsBasics of Implementation