【发布时间】:2015-12-30 14:50:21
【问题描述】:
我在做一个leetcode练习
https://leetcode.com/problems/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"
我不太确定what is the smallest in lexicographical order 以及为什么给定“cbacdcbc”那么答案将是“acdb”
提前感谢您的回答:)
【问题讨论】:
标签: algorithm