【lintcode】834. Remove Duplicate Letters

题目描述:

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"

解题思路

  • 最小字典序:
posted @ 2018-05-31 19:01  wemo  阅读(234)  评论(0编辑  收藏  举报