103.有问题!!!!Remove Duplicate Letters

来源:互联网 发布:淘宝网鞋柜 编辑:程序博客网 时间:2024/05/29 19:14

Given a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and only once. You must make sure your result is the smallest in lexicographical order among all possible results.

Example:

Given "bcabc"
Return "abc"

Given "cbacdcbc"
Return "acdb"

Credits:
Special thanks to @dietpepsi for adding this problem and creating all test cases.

Subscribe to see which companies asked this question

有问题,还需要进一步理解。

http://www.bubuko.com/infodetail-1279963.html

http://www.mamicode.com/info-detail-1164490.html

附上两个比较好的连接,后面再做。

0 0