[LeetCode C++实现]316. Remove Duplicate Letters
Remove Duplicate
这道题目和1081. Smallest Subsequence of Distinct Characters是同一道题目,解题方法如下:
class Solution {
public:
string removeDuplicateLetters(string s) {
vector<int> dict(256, 0);
vector<bool> visited(256, false);
for(auto ch : s) dict[ch]++;
string result = "0";
/** the key idea is......