Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Description Romesh is given an integer n and a string num. He has to create the smallest number possible by removing n digits from num
Description
Romesh is given an integer and a string num. He has to create the smallest number possible by removing
digits from num the removed digits may or may not be contiguous The value returned must also be a string.
For example. If Ramesh has num and then we must remove the digits and to get the
smallest value ie
It should be noted that if after removing digits, the num is empty, you must return In addition, all leading
zeros must be removed before returning the string.
Can you help Ramesh find a solution to this problem?
Input Format The first line in input is and the second line contains a string.
Output Format Output is a string with the smallest possible value.
Constraints
The first line inputs an integer and the second line inputs a string num. The length of num is denoted by len.
len
en
Num may contain leading zeros.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started