C++ short easy to understand , using unordered_set
\nclass Solution {\npublic:\n    int longestBeautifulSubstring(string word) {\n        int ans = 0;\n        int start = 0;\n        unordered_set<char> set;\n 
```\nclass Solution {\npublic:\n    int longestBeautifulSubstring(string word) {\n        int ans = 0;\n        int start = 0;\n        unordered_set<char> set;\n        set.insert(word[0]);\n        for(int i=1; i<word.size(); ++i) {\n            if (word[i]<word[i-1]) {  \n                start = i;\n                set.clear();\n            }\n            set.insert(word[i]);\n            if (set.size()==5) ans = max(ans, i - start + 1);\n        }\n        return ans;\n    }\n};\n```
['C']