LeetCode 402. Remove K Digits in Java

In this post we will solve the LeetCode 402 Remove K Digits problem.

Given string num representing a non-negative integer num, and an integer k, 
return the smallest possible integer after removing k digits from num.

Constraints:

o 1 <= k <= num.length <= 10^5
o num consists of only digits.
o num does not have any leading zeros except for the zero itself.

If interested in this problem I suggest you read the current description in the LeetCode website. The requirements may be refined since this post. Continue reading “LeetCode 402. Remove K Digits in Java”