402. Remove K Digits || Top Interview Problem || Medium Level

Опубликовано: 20 Октябрь 2024
на канале: Mohit Bodhija
63
6

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:

Input: num = "1432219", k = 3
Output: "1219"
Explanation: Remove the three digits 4, 3, and 2 to form the new number 1219 which is the smallest.