最小值"/>
删除k个数字后的最小值
给定一个只包含数字的字符串,要求在原字符串基础上删除k个数字后,使新字符串的数字最小。
题目来源:LeetCode-402. Remove K Digits,原题目如下:
Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible.
Note:
- The length of num is less than 10002 and will be ≥ k.
- The given num does not contain any leading zero.
先考虑只删除一个数字的情况,比如:1753,删除一个元素后最小的数字为:153;再如:6493,删除一个元素后最小的数为:493;再如,12345&#
更多推荐
删除k个数字后的最小值
发布评论