easy sliding window concept || using hashmaps in cpp
class Solution {\npublic:\n    int longestBeautifulSubstring(string word) {\n        vectorA(26,0);\n        int j=0 ,i=0;\n        int n=word.size();\n        
class Solution {\npublic:\n    int longestBeautifulSubstring(string word) {\n        vector<int>A(26,0);\n        int j=0 ,i=0;\n        int n=word.size();\n        \n        int count =0,ans=0;\n        while(i<n)\n        {\n            if(i>0 and i!=j and word[i]<word[i-1])\n            {\n                for(int i=0;i<26;i++)\n                    A[i]=0; \n                \n                j=i;\n                count=0;\n                \n            }\n            if(A[word[i]-\'a\']==0)count++;\n            A[word[i]-\'a\']++;\n            \n            if(count==5)ans=max(ans,i-j+1);\n            \n            i++;\n            \n            \n        }\n        return ans;\n    }\n};
['C', 'Sliding Window']