JAVA | Lets  Bitmask | O(1) space , O(n) time
We create a bitmask of all the vowlels i.e a , e , i , o , u.\n2. for every character in word we update the currentMask , where charAt(i) >= charAt(i - 1).\n3. 
1. We create a bitmask of all the vowlels i.e a , e , i , o , u.\n2. for every character in word we update the currentMask , where charAt(i) >= charAt(i - 1).\n3. Where currentMask = originalMask , this could be a possible solution so we update out result\n4. where the order breaks i.e charAt(i) > charAt(i - 1) , we reset our current mask.\n\n```\n\n```public int longestBeautifulSubstring(String word) {``\n         int originalMask = 0 , res = 0;\n\t\t int currentMask = 0 | (1 << word.charAt(0) - \'a\');\n         char[] vowels = {\'a\' , \'e\' , \'i\' , \'o\' , \'u\'};\n        \n        for(int i = 0 ; i < vowels.length ; i++) \n\t\t    originalMask |= 1 << (vowels[i] - \'a\');\n          \n        for(int i = 1 , last = 0; i < word.length() ; i++) {    \n        \tif(word.charAt(i) >= word.charAt(i - 1)) {\n        \t\tcurrentMask |= 1 << (word.charAt(i) - \'a\');\n        \t\tres = originalMask == currentMask ? Math.max(res , i - last + 1) : res;\n        \t}\n        \telse {\n        \t\tcurrentMask =  0 | 1 << (word.charAt(i) - \'a\');\n        \t    last = i;\n        \t}\n        }     \n        return res;\n    }
['Bitmask', 'Java']