首页 > 技术文章 > 【lintcode】834. Remove Duplicate Letters

wemo 2018-05-31 19:01 原文

题目描述:

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"

解题思路

  • 最小字典序:

推荐阅读