402. Remove K Digits
Problem Statement
Given string num representing a non-negative integer num
, and an integer k
, return the smallest possible integer after removing k
digits from num
.
Example 1:
Example 2:
Example 3:
Constraints:
1 <= k <= num.length <= 105
num
consists of only digits.num
does not have any leading zeros except for the zero itself.
Intuition
Links
https://leetcode.com/problems/remove-k-digits/description/
Video Links
https://www.youtube.com/watch?v=cFabMOnJaq0&ab_channel=NeetCode
Approach 1:
C++
Approach 2:
C++
Approach 3:
C++
Approach 4:
C++
Similar Problems
Last updated