Largest Number
Practice
4.1 (34 votes)
Stacks
Basics of stacks
Data structures
C++
Problem
41% Success 7597 Attempts 30 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Given an integer N with D digits without any leading zeroes. Find the largest number which can be obtained by deleting exactly digits from the number N.

Note

  • Return the largest number without any leading zeroes.

Input format

  • First line contains integer N.
  • Second line contains integer K.

Output format

Return the largest number which can be obtained by deleting exactly K digits from the number N.

Constraints

\(N > 0 \\ 1 \le D \le 10^6 \\ 0 \le K < 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:30
41 votes
Tags:
Data StructuresBasics of StacksStackTreesStacks
Points:30
12 votes
Tags:
QueuesBasics of QueuesBasics of StacksC++Data StructuresStacks
Points:30
40 votes
Tags:
ApprovedData StructuresMathMediumStacks