not a easy python solution, hahaha...
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:  O(n)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1) : max size of seen and stack can only be size of 5\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def longestBeautifulSubstring(self, s: str) -> int:\n        stack = [\'u\',\'o\',\'i\',\'e\',\'a\']\n        seen = []\n        maxi = 0\n        r = 0\n        c = 0\n        while r < len(s):\n            char = s[r]\n            if not stack:\n                if s[r] == "u":\n                    c += 1\n                else:\n                    maxi = max(maxi, c)\n                    c = 0\n                    stack = [\'u\',\'o\',\'i\',\'e\',\'a\']\n                    seen.clear()\n                    if s[r] == stack[-1] or (seen and seen[-1] == s[r]):\n                        if s[r] == stack[-1]:\n                            seen.append(stack.pop(-1))\n                        c += 1\n            elif s[r] == stack[-1] or (seen and seen[-1] == s[r]):\n                if s[r] == stack[-1]:\n                    seen.append(stack.pop(-1))\n                c += 1\n            else:\n                if not stack:\n                    maxi = max(maxi, c)\n                c = 0\n                stack = [\'u\',\'o\',\'i\',\'e\',\'a\']\n                seen.clear()\n                if s[r] == stack[-1] or (seen and seen[-1] == s[r]):\n                    if s[r] == stack[-1]:\n                        seen.append(stack.pop(-1))\n                    c += 1\n            r += 1\n        if not stack:\n            maxi = max(maxi, c)\n        return maxi\n```
['Python3']