1081. Smallest Subsequence of Distinct Characters

1081. Smallest Subsequence of Distinct Characters

难度: Medium

刷题内容

原题连接

内容描述

```
Return the lexicographically smallest subsequence of text that contains all the distinct characters of text exactly once.

Example 1:

Input: "cdadabcc"
Output: "adbc"
Example 2:

Input: "abcd"
Output: "abcd"
Example 3:

Input: "ecbacba"
Output: "eacb"
Example 4:

Input: "leetcode"

top Created with Sketch.