You are an expert Python programmer. Write correct, efficient Python 3 code that solves the problem and passes all tests. Output the code in the following format: ```python
<code>
```

PROBLEM:
You are given two strings s and pattern.
A string x is called almost equal to y if you can change at most one character in x to make it identical to y.
Return the smallest starting index of a substring in s that is almost equal to pattern. If no such index exists, return -1.
A substring is a contiguous non-empty sequence of characters within a string.

Example 1:

Input: s = "abcdefg", pattern = "bcdffg"
Output: 1
Explanation:
The substring s[1..6] == "bcdefg" can be converted to "bcdffg" by changing s[4] to "f".

Example 2:

Input: s = "ababbababa", pattern = "bacaba"
Output: 4
Explanation:
The substring s[4..9] == "bababa" can be converted to "bacaba" by changing s[6] to "c".

Example 3:

Input: s = "abcd", pattern = "dba"
Output: -1

Example 4:

Input: s = "dde", pattern = "d"
Output: 0

Constraints:

1 <= pattern.length < s.length <= 105
s and pattern consist only of lowercase English letters.

Follow-up: Could you solve the problem if at most k consecutive characters can be changed?

Your solution to the problem should be a method of the class Solution called minStartingIndex and should pass all tests. Use the following starter code:
```python
class Solution:
    def minStartingIndex(self, s: str, pattern: str) -> int:
        # Add your code here
```

SOLUTION:

Question:
PROBLEM:
You are given two strings s and pattern.
A string x is called almost equal to y if you can change at most one character in x to make it identical to y.
Return the smallest starting index of a substring in s that is almost equal to pattern. If no such index exists, return -1.
A substring is a contiguous non-empty sequence of characters within a string.

Example 1:

Input: s = "abcdefg", pattern = "bcdffg"
Output: 1
Explanation:
The substring s[1..6] == "bcdefg" can be converted to "bcdffg" by changing s[4] to "f".

Example 2:

Input: s = "ababbababa", pattern = "bacaba"
Output: 4
Explanation:
The substring s[4..9] == "bababa" can be converted to "bacaba" by changing s[6] to "c".

Example 3:

Input: s = "abcd", pattern = "dba"
Output: -1

Example 4:

Input: s = "dde", pattern = "d"
Output: 0

Constraints:

1 <= pattern.length < s.length <= 105
s and pattern consist only of lowercase English letters.

Follow-up: Could you solve the problem if at most k consecutive characters can be changed?

Your solution to the problem should be a method of the class Solution called minStartingIndex and should pass all tests. Use the following starter code:
```python
class Solution:
    def minStartingIndex(self, s: str, pattern: str) -> int:
        # Add your code here
```

SOLUTION:

assert Solution().minStartingIndex(s = "mississippi", pattern = "missiippi") == -1

assert Solution().minStartingIndex(s = "abcd", pattern = "dba") == -1

assert Solution().minStartingIndex(s = "abcdefghij", pattern = "abcdefghii") == 0

assert Solution().minStartingIndex(s = "abcdefghij", pattern = "abcdefghij") == 0

assert Solution().minStartingIndex(s = "aaa", pattern = "aba") == 0

assert Solution().minStartingIndex(s = "abcdefg", pattern = "bcdffg") == 1

assert Solution().minStartingIndex(s = "mississippi", pattern = "misosippi") == -1

assert Solution().minStartingIndex(s = "aabbccdd", pattern = "aabbccde") == 0

assert Solution().minStartingIndex(s = "xyz", pattern = "xya") == 0

assert Solution().minStartingIndex(s = "ababbababa", pattern = "bacaba") == 4

assert Solution().minStartingIndex(s = "mississippi", pattern = "mississipi") == 0

assert Solution().minStartingIndex(s = "testcase", pattern = "tasteing") == -1

assert Solution().minStartingIndex(s = "mississippi", pattern = "misissippi") == -1

assert Solution().minStartingIndex(s = "aaaabbbb", pattern = "aaaa") == 0

assert Solution().minStartingIndex(s = "abcdefgh", pattern = "hgfedcba") == -1

assert Solution().minStartingIndex(s = "programming", pattern = "provramming") == 0

assert Solution().minStartingIndex(s = "dde", pattern = "d") == 0

assert Solution().minStartingIndex(s = "pattern", pattern = "patern") == -1

assert Solution().minStartingIndex(s = "abcde", pattern = "bcdef") == -1

assert Solution().minStartingIndex(s = "zzzzzzzzzz", pattern = "zzzzzzzzzz") == 0

assert Solution().minStartingIndex(s = "abcdefgh", pattern = "aefgh") == 3

assert Solution().minStartingIndex(s = "programming", pattern = "prigramming") == 0

assert Solution().minStartingIndex(s = "aabbcc", pattern = "aabccc") == 0

assert Solution().minStartingIndex(s = "hello", pattern = "hallo") == 0

assert Solution().minStartingIndex(s = "algorithm", pattern = "alorithmn") == -1

assert Solution().minStartingIndex(s = "abcabcabcabcabcabcabcabcabcabc", pattern = "abcabcabcabcabcabcabcabcabcbca") == -1

assert Solution().minStartingIndex(s = "abcdeabcdeabcdeabcdeabcde", pattern = "abcdeabcdeabcdeabcdeabcae") == 0

assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyz", pattern = "azcdefghijklmnopqrstuvwxyb") == -1

assert Solution().minStartingIndex(s = "aaaaabaaaaabaaaaabaaaaabaaaaab", pattern = "aaaaabaaaaabaaaaabaaaaabaaaaaa") == 0

assert Solution().minStartingIndex(s = "abcdefghij", pattern = "abcdefghjk") == -1

assert Solution().minStartingIndex(s = "aabbccddeeffgg", pattern = "aabbccddeeffgf") == 0

assert Solution().minStartingIndex(s = "zzzzzzzzzzzzzzzzzzzz", pattern = "zzzzzzzzzzzzzzzzzzza") == 0

assert Solution().minStartingIndex(s = "longerpatternstring", pattern = "longerpatternstriang") == -1

assert Solution().minStartingIndex(s = "longstringlongstringlongstring", pattern = "longstringlongstrignlongstring") == -1

assert Solution().minStartingIndex(s = "abababababababababab", pattern = "abababababababababaa") == 0

assert Solution().minStartingIndex(s = "aaaaabaaaabaaaaabaaaaab", pattern = "bbbbabaaaabaaaabaaaaab") == -1

assert Solution().minStartingIndex(s = "repeatedrepeatedrepeated", pattern = "repeatedrepeatedrepeatea") == 0

assert Solution().minStartingIndex(s = "abcdeabcdeabcdeabcdeabcdeabcde", pattern = "abcdeabcdeabcdeabcdeabcdeabcdf") == 0

assert Solution().minStartingIndex(s = "abcdabcdabcdabcdabcdabcdabcdabcd", pattern = "abcdbcdabcdabcdabcdabcdabcdabcdabcd") == -1

assert Solution().minStartingIndex(s = "hellotherehello", pattern = "hellotherehelll") == 0

assert Solution().minStartingIndex(s = "aaabbbcccdddfffggghhh", pattern = "aaabbbcccdddfffggghhg") == 0

assert Solution().minStartingIndex(s = "abacabadabacabad", pattern = "abacabadabacabxx") == -1

assert Solution().minStartingIndex(s = "repeatedstringrepeated", pattern = "repeatedstringrepeaa") == 0

assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyz", pattern = "abcdefghijklmnopqrstuvwxzy") == -1

assert Solution().minStartingIndex(s = "xylophone", pattern = "xylophone") == 0

assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyz", pattern = "abcdefghijklmnopqrstuvwxyi") == 0

assert Solution().minStartingIndex(s = "abcdefghijabcdefghijabcdefghij", pattern = "abcdefghijabcdefghijabcdefghii") == 0

assert Solution().minStartingIndex(s = "abacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacaba", pattern = "abacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabz") == 0

assert Solution().minStartingIndex(s = "abcdefgabcdefgabcdefg", pattern = "abcdefgabcdefgxabcdefg") == -1

assert Solution().minStartingIndex(s = "oneonetwoonetwoonetwoonetwo", pattern = "oneonetwoonetwoonetwoonetwotwo") == -1

assert Solution().minStartingIndex(s = "abracadabra", pattern = "abracadabrr") == 0

assert Solution().minStartingIndex(s = "ababababababababab", pattern = "abababababababaxab") == 0

assert Solution().minStartingIndex(s = "samelettersamelettersame", pattern = "samelettersamelettersamx") == 0

assert Solution().minStartingIndex(s = "quickbrownfoxjumpsoverthelazydog", pattern = "quickbrownfoxjumpsoverthelazymog") == 0

assert Solution().minStartingIndex(s = "aaaaabaaaabaaaaabaaaab", pattern = "aaaaabaaaabaaaaabaaaab") == 0

assert Solution().minStartingIndex(s = "abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc", pattern = "abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabca") == 0

assert Solution().minStartingIndex(s = "aaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaab", pattern = "aaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaba") == 0

assert Solution().minStartingIndex(s = "abcdefghijabcdefghijabcdefghij", pattern = "abcdefghijabcdefghijabxxefij") == -1

assert Solution().minStartingIndex(s = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", pattern = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz") == 0

assert Solution().minStartingIndex(s = "xyzzzyxyzzzyx", pattern = "xyzzzyxyzzzyy") == 0

assert Solution().minStartingIndex(s = "abcdefghijkabcdefghijk", pattern = "abcdefghijkabcdefghiij") == -1

assert Solution().minStartingIndex(s = "zzzzzzzzzzzzzzzzzzzzzzzzzz", pattern = "zzzzzzzzzzzzzzzzzzzzzzzzzz") == 0

assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyz", pattern = "abcdefghijklmnopqrstuvwxzz") == 0

assert Solution().minStartingIndex(s = "abacabadabacabadabacaba", pattern = "abacabadabacabadabacabb") == 0

assert Solution().minStartingIndex(s = "abcdefghijabcdefghijabcdefghij", pattern = "abcdefghijabcdefghijabcdefghik") == 0

assert Solution().minStartingIndex(s = "repeatedpatternrepeatedpattern", pattern = "repeatedpartternrepeatedpattern") == -1

assert Solution().minStartingIndex(s = "abcdefghijklnopqrstuvwxyz", pattern = "bcdefghijklnopqrstuvwxyza") == -1

assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyz", pattern = "abcdefghijklmnopqrstuvwxyx") == 0

assert Solution().minStartingIndex(s = "abcdeabcdeabcdeabcdeabcdeabcde", pattern = "abcdeabcdeabcdeabcdeabcdeabcde") == 0

assert Solution().minStartingIndex(s = "aaaabbbbccccdddd", pattern = "aaaacccc") == -1

assert Solution().minStartingIndex(s = "hellohellohellohello", pattern = "hellohellohelllohello") == -1

assert Solution().minStartingIndex(s = "aabbccddeeffgg", pattern = "aabbccddeefggh") == -1

assert Solution().minStartingIndex(s = "aaaabbbbccccddddeeeeffffgggghhhhiiiijjjjkkkkllllmmmmnnnnooooppppqqqqrrrrssssttttuuuuvvvvwwwwxxxxyyyyzzzz", pattern = "aaaabbbbccccddddeeeeffffgggghhhhiiiijjjjkkkkllllmmmmnnnnooooppppqqqqrrrrssssttttuuuuvvvvwwwwxxxxyyyyzzza") == 0

assert Solution().minStartingIndex(s = "aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz", pattern = "aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyza") == 0

assert Solution().minStartingIndex(s = "abracadabra", pattern = "abracadabrc") == 0

assert Solution().minStartingIndex(s = "onetwothreefourfive", pattern = "onetwothreefourfie") == 0

assert Solution().minStartingIndex(s = "abcdefghijabcdefghij", pattern = "abcdefghijabcdefghiz") == 0

assert Solution().minStartingIndex(s = "sequencecomparison", pattern = "sequencecomporison") == 0

assert Solution().minStartingIndex(s = "repeatedstringrepeatedstring", pattern = "repeatedstringrepeateedstring") == -1

assert Solution().minStartingIndex(s = "aaaaabbbbbcccccddddd", pattern = "aaaaabbbbbbccccddddd") == 0

assert Solution().minStartingIndex(s = "qwertqwertqwertqwert", pattern = "qwertqwertqwertqweqt") == 0

assert Solution().minStartingIndex(s = "findalmostequalhere", pattern = "findalmosteuqalhere") == -1

assert Solution().minStartingIndex(s = "longstringthatgoesonandone", pattern = "longstringthatgoesonandoo") == 0

assert Solution().minStartingIndex(s = "patternmatching", pattern = "patternmacheing") == -1

assert Solution().minStartingIndex(s = "thisisaverylongstringwithmanycharacters", pattern = "thisisaverylongstringwithmanycharacterz") == 0

assert Solution().minStartingIndex(s = "abcdefghikjlmnopqrstuvwxyz", pattern = "abcdefghikjlmnopqrstuvwxyx") == 0

assert Solution().minStartingIndex(s = "a", pattern = "b") == 0

assert Solution().minStartingIndex(s = "aaaaaabaaaaaa", pattern = "aaaaaaaaaaaaa") == 0

assert Solution().minStartingIndex(s = "uniquecharacters", pattern = "uniquecharacteers") == -1

assert Solution().minStartingIndex(s = "abcdeabcdeabcde", pattern = "abfdeabfdeabfde") == -1

assert Solution().minStartingIndex(s = "xyzxyzxyzxyzxyz", pattern = "xyzxyzxyzxyzyxx") == -1

assert Solution().minStartingIndex(s = "abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc", pattern = "abcdabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc") == -1

assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyz", pattern = "abxyzabxyzabxyz") == -1

assert Solution().minStartingIndex(s = "abcdeabcdeabcdeabcdeabcde", pattern = "abcdeabcdeabcdeabcdeabcde") == 0

assert Solution().minStartingIndex(s = "abacabadabacaba", pattern = "abacabadabacaba") == 0

assert Solution().minStartingIndex(s = "aabbccddeeffgghhiijjkkll", pattern = "aabbccddeeffgghhiijjkklm") == 0

assert Solution().minStartingIndex(s = "abcabcabcabcabcabc", pattern = "abcabcabcabcabcbab") == -1

assert Solution().minStartingIndex(s = "abracadabraabracadabra", pattern = "abracadabrabracadabc") == -1

assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyz", pattern = "abcdefghijklmnopqrstuvwxya") == 0

assert Solution().minStartingIndex(s = "abcdefghijabcdefghijabcdefghij", pattern = "abcdefghijabcdefghijabcdefghiz") == 0

assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyz", pattern = "abcdefghijklmnopqrstuvwxyy") == 0

assert Solution().minStartingIndex(s = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", pattern = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy") == -1

assert Solution().minStartingIndex(s = "longstringwithrepeatedpatterns", pattern = "longstrintwithrepeatedpatterns") == 0

assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", pattern = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxya") == 0

assert Solution().minStartingIndex(s = "lkjihgfedcba", pattern = "lkjihgfedcbz") == 0

assert Solution().minStartingIndex(s = "zzzzzzzzzzzzzzzzzzzzz", pattern = "zzzzzzzzzzzzzzzzzzzzz") == 0

assert Solution().minStartingIndex(s = "almostequal", pattern = "almosnequal") == 0

assert Solution().minStartingIndex(s = "abcdabcdabcdabcd", pattern = "dcbaabdcbaabcdabcd") == -1

assert Solution().minStartingIndex(s = "veryverylongstringwithalotofcharacters", pattern = "veryverylongstringwithalotofcharracters") == -1

assert Solution().minStartingIndex(s = "aaaaaaaaaabaaaaaaaaaabaaaaaaaaaab", pattern = "aaaaaaaaaaaabaaaaaaaaaab") == 9

assert Solution().minStartingIndex(s = "samestartswithsame", pattern = "samestartswithsamg") == 0

assert Solution().minStartingIndex(s = "hellohellohellohellohello", pattern = "hellolhellohellohellohello") == -1

assert Solution().minStartingIndex(s = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", pattern = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz") == 0

assert Solution().minStartingIndex(s = "mississippi", pattern = "mississipppp") == -1

assert Solution().minStartingIndex(s = "abcabcabcabcabcabcabcabc", pattern = "abcabcabcabcabcabcabxcabc") == -1

assert Solution().minStartingIndex(s = "hellohellohellohello", pattern = "hellohellohelolohello") == -1

assert Solution().minStartingIndex(s = "abcde", pattern = "edcba") == -1

assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyz", pattern = "abcdefghijklmnopqrstuvwxyz") == 0

assert Solution().minStartingIndex(s = "zzzzzzzzzzzzzzzz", pattern = "zzzzzzzzzzzzzzzx") == 0

assert Solution().minStartingIndex(s = "longpatternstring", pattern = "longpatternstrong") == 0

assert Solution().minStartingIndex(s = "aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz", pattern = "aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzw") == 0

assert Solution().minStartingIndex(s = "aaaaaaaaaaaaaaaaaaaaaaaaaa", pattern = "aaaaaaaaaaaaaaaaaaaaaaaab") == 0

assert Solution().minStartingIndex(s = "longlonglonglonglong", pattern = "longlonglonglonglong") == 0

assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", pattern = "zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba") == -1

assert Solution().minStartingIndex(s = "complexsubstringexample", pattern = "complexsubstrigexampl") == -1

assert Solution().minStartingIndex(s = "abcabcabcabcabcabcabcabc", pattern = "abcbcabcabcabcabcabcabcabc") == -1

assert Solution().minStartingIndex(s = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", pattern = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzaa") == -1

assert Solution().minStartingIndex(s = "aaaaaabaaaaaabaaaaaab", pattern = "aaaaaabaaaaaabbaaaaaa") == -1

assert Solution().minStartingIndex(s = "xyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyz", pattern = "xyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzz") == -1

assert Solution().minStartingIndex(s = "abacabadabacaba", pattern = "abacabadabacaca") == 0

assert Solution().minStartingIndex(s = "abcdeabcdeabcdeabcdeabcde", pattern = "abcdeabcdeabcdeabcdeabcdd") == 0

assert Solution().minStartingIndex(s = "thisisaverylongstringthatwearetesting", pattern = "thisisaverylongstringthatwearetasting") == 0

assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", pattern = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyi") == 0

assert Solution().minStartingIndex(s = "abababababababababababababababababab", pattern = "bababababababababababababababababa") == 1

Answer: assert Solution().minStartingIndex(s = "mississippi", pattern = "missiippi") == -1

Answer: assert Solution().minStartingIndex(s = "abcd", pattern = "dba") == -1

Answer: assert Solution().minStartingIndex(s = "abcdefghij", pattern = "abcdefghii") == 0

Answer: assert Solution().minStartingIndex(s = "abcdefghij", pattern = "abcdefghij") == 0

Answer: assert Solution().minStartingIndex(s = "aaa", pattern = "aba") == 0

Answer: assert Solution().minStartingIndex(s = "abcdefg", pattern = "bcdffg") == 1

Answer: assert Solution().minStartingIndex(s = "mississippi", pattern = "misosippi") == -1

Answer: assert Solution().minStartingIndex(s = "aabbccdd", pattern = "aabbccde") == 0

Answer: assert Solution().minStartingIndex(s = "xyz", pattern = "xya") == 0

Answer: assert Solution().minStartingIndex(s = "ababbababa", pattern = "bacaba") == 4

Answer: assert Solution().minStartingIndex(s = "mississippi", pattern = "mississipi") == 0

Answer: assert Solution().minStartingIndex(s = "testcase", pattern = "tasteing") == -1

Answer: assert Solution().minStartingIndex(s = "mississippi", pattern = "misissippi") == -1

Answer: assert Solution().minStartingIndex(s = "aaaabbbb", pattern = "aaaa") == 0

Answer: assert Solution().minStartingIndex(s = "abcdefgh", pattern = "hgfedcba") == -1

Answer: assert Solution().minStartingIndex(s = "programming", pattern = "provramming") == 0

Answer: assert Solution().minStartingIndex(s = "dde", pattern = "d") == 0

Answer: assert Solution().minStartingIndex(s = "pattern", pattern = "patern") == -1

Answer: assert Solution().minStartingIndex(s = "abcde", pattern = "bcdef") == -1

Answer: assert Solution().minStartingIndex(s = "zzzzzzzzzz", pattern = "zzzzzzzzzz") == 0

Answer: assert Solution().minStartingIndex(s = "abcdefgh", pattern = "aefgh") == 3

Answer: assert Solution().minStartingIndex(s = "programming", pattern = "prigramming") == 0

Answer: assert Solution().minStartingIndex(s = "aabbcc", pattern = "aabccc") == 0

Answer: assert Solution().minStartingIndex(s = "hello", pattern = "hallo") == 0

Answer: assert Solution().minStartingIndex(s = "algorithm", pattern = "alorithmn") == -1

Answer: assert Solution().minStartingIndex(s = "abcabcabcabcabcabcabcabcabcabc", pattern = "abcabcabcabcabcabcabcabcabcbca") == -1

Answer: assert Solution().minStartingIndex(s = "abcdeabcdeabcdeabcdeabcde", pattern = "abcdeabcdeabcdeabcdeabcae") == 0

Answer: assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyz", pattern = "azcdefghijklmnopqrstuvwxyb") == -1

Answer: assert Solution().minStartingIndex(s = "aaaaabaaaaabaaaaabaaaaabaaaaab", pattern = "aaaaabaaaaabaaaaabaaaaabaaaaaa") == 0

Answer: assert Solution().minStartingIndex(s = "abcdefghij", pattern = "abcdefghjk") == -1

Answer: assert Solution().minStartingIndex(s = "aabbccddeeffgg", pattern = "aabbccddeeffgf") == 0

Answer: assert Solution().minStartingIndex(s = "zzzzzzzzzzzzzzzzzzzz", pattern = "zzzzzzzzzzzzzzzzzzza") == 0

Answer: assert Solution().minStartingIndex(s = "longerpatternstring", pattern = "longerpatternstriang") == -1

Answer: assert Solution().minStartingIndex(s = "longstringlongstringlongstring", pattern = "longstringlongstrignlongstring") == -1

Answer: assert Solution().minStartingIndex(s = "abababababababababab", pattern = "abababababababababaa") == 0

Answer: assert Solution().minStartingIndex(s = "aaaaabaaaabaaaaabaaaaab", pattern = "bbbbabaaaabaaaabaaaaab") == -1

Answer: assert Solution().minStartingIndex(s = "repeatedrepeatedrepeated", pattern = "repeatedrepeatedrepeatea") == 0

Answer: assert Solution().minStartingIndex(s = "abcdeabcdeabcdeabcdeabcdeabcde", pattern = "abcdeabcdeabcdeabcdeabcdeabcdf") == 0

Answer: assert Solution().minStartingIndex(s = "abcdabcdabcdabcdabcdabcdabcdabcd", pattern = "abcdbcdabcdabcdabcdabcdabcdabcdabcd") == -1

Answer: assert Solution().minStartingIndex(s = "hellotherehello", pattern = "hellotherehelll") == 0

Answer: assert Solution().minStartingIndex(s = "aaabbbcccdddfffggghhh", pattern = "aaabbbcccdddfffggghhg") == 0

Answer: assert Solution().minStartingIndex(s = "abacabadabacabad", pattern = "abacabadabacabxx") == -1

Answer: assert Solution().minStartingIndex(s = "repeatedstringrepeated", pattern = "repeatedstringrepeaa") == 0

Answer: assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyz", pattern = "abcdefghijklmnopqrstuvwxzy") == -1

Answer: assert Solution().minStartingIndex(s = "xylophone", pattern = "xylophone") == 0

Answer: assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyz", pattern = "abcdefghijklmnopqrstuvwxyi") == 0

Answer: assert Solution().minStartingIndex(s = "abcdefghijabcdefghijabcdefghij", pattern = "abcdefghijabcdefghijabcdefghii") == 0

Answer: assert Solution().minStartingIndex(s = "abacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacaba", pattern = "abacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabadabacabz") == 0

Answer: assert Solution().minStartingIndex(s = "abcdefgabcdefgabcdefg", pattern = "abcdefgabcdefgxabcdefg") == -1

Answer: assert Solution().minStartingIndex(s = "oneonetwoonetwoonetwoonetwo", pattern = "oneonetwoonetwoonetwoonetwotwo") == -1

Answer: assert Solution().minStartingIndex(s = "abracadabra", pattern = "abracadabrr") == 0

Answer: assert Solution().minStartingIndex(s = "ababababababababab", pattern = "abababababababaxab") == 0

Answer: assert Solution().minStartingIndex(s = "samelettersamelettersame", pattern = "samelettersamelettersamx") == 0

Answer: assert Solution().minStartingIndex(s = "quickbrownfoxjumpsoverthelazydog", pattern = "quickbrownfoxjumpsoverthelazymog") == 0

Answer: assert Solution().minStartingIndex(s = "aaaaabaaaabaaaaabaaaab", pattern = "aaaaabaaaabaaaaabaaaab") == 0

Answer: assert Solution().minStartingIndex(s = "abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc", pattern = "abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabca") == 0

Answer: assert Solution().minStartingIndex(s = "aaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaab", pattern = "aaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaaabaaaaba") == 0

Answer: assert Solution().minStartingIndex(s = "abcdefghijabcdefghijabcdefghij", pattern = "abcdefghijabcdefghijabxxefij") == -1

Answer: assert Solution().minStartingIndex(s = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", pattern = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz") == 0

Answer: assert Solution().minStartingIndex(s = "xyzzzyxyzzzyx", pattern = "xyzzzyxyzzzyy") == 0

Answer: assert Solution().minStartingIndex(s = "abcdefghijkabcdefghijk", pattern = "abcdefghijkabcdefghiij") == -1

Answer: assert Solution().minStartingIndex(s = "zzzzzzzzzzzzzzzzzzzzzzzzzz", pattern = "zzzzzzzzzzzzzzzzzzzzzzzzzz") == 0

Answer: assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyz", pattern = "abcdefghijklmnopqrstuvwxzz") == 0

Answer: assert Solution().minStartingIndex(s = "abacabadabacabadabacaba", pattern = "abacabadabacabadabacabb") == 0

Answer: assert Solution().minStartingIndex(s = "abcdefghijabcdefghijabcdefghij", pattern = "abcdefghijabcdefghijabcdefghik") == 0

Answer: assert Solution().minStartingIndex(s = "repeatedpatternrepeatedpattern", pattern = "repeatedpartternrepeatedpattern") == -1

Answer: assert Solution().minStartingIndex(s = "abcdefghijklnopqrstuvwxyz", pattern = "bcdefghijklnopqrstuvwxyza") == -1

Answer: assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyz", pattern = "abcdefghijklmnopqrstuvwxyx") == 0

Answer: assert Solution().minStartingIndex(s = "abcdeabcdeabcdeabcdeabcdeabcde", pattern = "abcdeabcdeabcdeabcdeabcdeabcde") == 0

Answer: assert Solution().minStartingIndex(s = "aaaabbbbccccdddd", pattern = "aaaacccc") == -1

Answer: assert Solution().minStartingIndex(s = "hellohellohellohello", pattern = "hellohellohelllohello") == -1

Answer: assert Solution().minStartingIndex(s = "aabbccddeeffgg", pattern = "aabbccddeefggh") == -1

Answer: assert Solution().minStartingIndex(s = "aaaabbbbccccddddeeeeffffgggghhhhiiiijjjjkkkkllllmmmmnnnnooooppppqqqqrrrrssssttttuuuuvvvvwwwwxxxxyyyyzzzz", pattern = "aaaabbbbccccddddeeeeffffgggghhhhiiiijjjjkkkkllllmmmmnnnnooooppppqqqqrrrrssssttttuuuuvvvvwwwwxxxxyyyyzzza") == 0

Answer: assert Solution().minStartingIndex(s = "aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz", pattern = "aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyza") == 0

Answer: assert Solution().minStartingIndex(s = "abracadabra", pattern = "abracadabrc") == 0

Answer: assert Solution().minStartingIndex(s = "onetwothreefourfive", pattern = "onetwothreefourfie") == 0

Answer: assert Solution().minStartingIndex(s = "abcdefghijabcdefghij", pattern = "abcdefghijabcdefghiz") == 0

Answer: assert Solution().minStartingIndex(s = "sequencecomparison", pattern = "sequencecomporison") == 0

Answer: assert Solution().minStartingIndex(s = "repeatedstringrepeatedstring", pattern = "repeatedstringrepeateedstring") == -1

Answer: assert Solution().minStartingIndex(s = "aaaaabbbbbcccccddddd", pattern = "aaaaabbbbbbccccddddd") == 0

Answer: assert Solution().minStartingIndex(s = "qwertqwertqwertqwert", pattern = "qwertqwertqwertqweqt") == 0

Answer: assert Solution().minStartingIndex(s = "findalmostequalhere", pattern = "findalmosteuqalhere") == -1

Answer: assert Solution().minStartingIndex(s = "longstringthatgoesonandone", pattern = "longstringthatgoesonandoo") == 0

Answer: assert Solution().minStartingIndex(s = "patternmatching", pattern = "patternmacheing") == -1

Answer: assert Solution().minStartingIndex(s = "thisisaverylongstringwithmanycharacters", pattern = "thisisaverylongstringwithmanycharacterz") == 0

Answer: assert Solution().minStartingIndex(s = "abcdefghikjlmnopqrstuvwxyz", pattern = "abcdefghikjlmnopqrstuvwxyx") == 0

Answer: assert Solution().minStartingIndex(s = "a", pattern = "b") == 0

Answer: assert Solution().minStartingIndex(s = "aaaaaabaaaaaa", pattern = "aaaaaaaaaaaaa") == 0

Answer: assert Solution().minStartingIndex(s = "uniquecharacters", pattern = "uniquecharacteers") == -1

Answer: assert Solution().minStartingIndex(s = "abcdeabcdeabcde", pattern = "abfdeabfdeabfde") == -1

Answer: assert Solution().minStartingIndex(s = "xyzxyzxyzxyzxyz", pattern = "xyzxyzxyzxyzyxx") == -1

Answer: assert Solution().minStartingIndex(s = "abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc", pattern = "abcdabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc") == -1

Answer: assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyz", pattern = "abxyzabxyzabxyz") == -1

Answer: assert Solution().minStartingIndex(s = "abcdeabcdeabcdeabcdeabcde", pattern = "abcdeabcdeabcdeabcdeabcde") == 0

Answer: assert Solution().minStartingIndex(s = "abacabadabacaba", pattern = "abacabadabacaba") == 0

Answer: assert Solution().minStartingIndex(s = "aabbccddeeffgghhiijjkkll", pattern = "aabbccddeeffgghhiijjkklm") == 0

Answer: assert Solution().minStartingIndex(s = "abcabcabcabcabcabc", pattern = "abcabcabcabcabcbab") == -1

Answer: assert Solution().minStartingIndex(s = "abracadabraabracadabra", pattern = "abracadabrabracadabc") == -1

Answer: assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyz", pattern = "abcdefghijklmnopqrstuvwxya") == 0

Answer: assert Solution().minStartingIndex(s = "abcdefghijabcdefghijabcdefghij", pattern = "abcdefghijabcdefghijabcdefghiz") == 0

Answer: assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyz", pattern = "abcdefghijklmnopqrstuvwxyy") == 0

Answer: assert Solution().minStartingIndex(s = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", pattern = "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy") == -1

Answer: assert Solution().minStartingIndex(s = "longstringwithrepeatedpatterns", pattern = "longstrintwithrepeatedpatterns") == 0

Answer: assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", pattern = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxya") == 0

Answer: assert Solution().minStartingIndex(s = "lkjihgfedcba", pattern = "lkjihgfedcbz") == 0

Answer: assert Solution().minStartingIndex(s = "zzzzzzzzzzzzzzzzzzzzz", pattern = "zzzzzzzzzzzzzzzzzzzzz") == 0

Answer: assert Solution().minStartingIndex(s = "almostequal", pattern = "almosnequal") == 0

Answer: assert Solution().minStartingIndex(s = "abcdabcdabcdabcd", pattern = "dcbaabdcbaabcdabcd") == -1

Answer: assert Solution().minStartingIndex(s = "veryverylongstringwithalotofcharacters", pattern = "veryverylongstringwithalotofcharracters") == -1

Answer: assert Solution().minStartingIndex(s = "aaaaaaaaaabaaaaaaaaaabaaaaaaaaaab", pattern = "aaaaaaaaaaaabaaaaaaaaaab") == 9

Answer: assert Solution().minStartingIndex(s = "samestartswithsame", pattern = "samestartswithsamg") == 0

Answer: assert Solution().minStartingIndex(s = "hellohellohellohellohello", pattern = "hellolhellohellohellohello") == -1

Answer: assert Solution().minStartingIndex(s = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", pattern = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz") == 0

Answer: assert Solution().minStartingIndex(s = "mississippi", pattern = "mississipppp") == -1

Answer: assert Solution().minStartingIndex(s = "abcabcabcabcabcabcabcabc", pattern = "abcabcabcabcabcabcabxcabc") == -1

Answer: assert Solution().minStartingIndex(s = "hellohellohellohello", pattern = "hellohellohelolohello") == -1

Answer: assert Solution().minStartingIndex(s = "abcde", pattern = "edcba") == -1

Answer: assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyz", pattern = "abcdefghijklmnopqrstuvwxyz") == 0

Answer: assert Solution().minStartingIndex(s = "zzzzzzzzzzzzzzzz", pattern = "zzzzzzzzzzzzzzzx") == 0

Answer: assert Solution().minStartingIndex(s = "longpatternstring", pattern = "longpatternstrong") == 0

Answer: assert Solution().minStartingIndex(s = "aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz", pattern = "aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzw") == 0

Answer: assert Solution().minStartingIndex(s = "aaaaaaaaaaaaaaaaaaaaaaaaaa", pattern = "aaaaaaaaaaaaaaaaaaaaaaaab") == 0

Answer: assert Solution().minStartingIndex(s = "longlonglonglonglong", pattern = "longlonglonglonglong") == 0

Answer: assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", pattern = "zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba") == -1

Answer: assert Solution().minStartingIndex(s = "complexsubstringexample", pattern = "complexsubstrigexampl") == -1

Answer: assert Solution().minStartingIndex(s = "abcabcabcabcabcabcabcabc", pattern = "abcbcabcabcabcabcabcabcabc") == -1

Answer: assert Solution().minStartingIndex(s = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", pattern = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzaa") == -1

Answer: assert Solution().minStartingIndex(s = "aaaaaabaaaaaabaaaaaab", pattern = "aaaaaabaaaaaabbaaaaaa") == -1

Answer: assert Solution().minStartingIndex(s = "xyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyz", pattern = "xyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzxyzz") == -1

Answer: assert Solution().minStartingIndex(s = "abacabadabacaba", pattern = "abacabadabacaca") == 0

Answer: assert Solution().minStartingIndex(s = "abcdeabcdeabcdeabcdeabcde", pattern = "abcdeabcdeabcdeabcdeabcdd") == 0

Answer: assert Solution().minStartingIndex(s = "thisisaverylongstringthatwearetesting", pattern = "thisisaverylongstringthatwearetasting") == 0

Answer: assert Solution().minStartingIndex(s = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", pattern = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyi") == 0

Answer: assert Solution().minStartingIndex(s = "abababababababababababababababababab", pattern = "bababababababababababababababababa") == 1

import random
import functools
import collections
import string
import math
import datetime

from typing import *
from functools import *
from collections import *
from itertools import *
from heapq import *
from bisect import *
from string import *
from operator import *
from math import *

inf = float('inf')

class ListNode:
    def __init__(self, val=0, next=None):
        self.val = val
        self.next = next

def list_node(values: list):
    if not values:
        return None
    head = ListNode(values[0])
    p = head
    for val in values[1:]:
        node = ListNode(val)
        p.next = node
        p = node
    return head

def is_same_list(p1, p2):
    if p1 is None and p2 is None:
        return True
    if not p1 or not p2:
        return False
    return p1.val == p2.val and is_same_list(p1.next, p2.next)

class TreeNode:
    def __init__(self, val=0, left=None, right=None):
        self.val = val
        self.left = left
        self.right = right

def tree_node(values: list):
    if not values:
        return None
    root = TreeNode(values[0])
    i = 1
    queue = deque()
    queue.append(root)
    while queue:
        node = queue.popleft()
        if i < len(values) and values[i] is not None:
            node.left = TreeNode(values[i])
            queue.append(node.left)
        i += 1
        if i < len(values) and values[i] is not None:
            node.right = TreeNode(values[i])
            queue.append(node.right)
        i += 1
    return root

def is_same_tree(p, q):
    if not p and not q:
        return True
    elif not p or not q:
        return False
    elif p.val != q.val:
        return False
    else:
        return is_same_tree(p.left, q.left) and is_same_tree(p.right, q.right)

class Solution:
  def minStartingIndex(self, s: str, pattern: str) -> int:
    z1 = self._zFunction(pattern + s)
    z2 = self._zFunction(pattern[::-1] + s[::-1])

    # Match s[i..i + len(pattern) - 1] with `pattern` from both the prefix and
    # the suffix.
    for i in range(len(s) - len(pattern) + 1):
      if z1[len(pattern) + i] + z2[len(s) - i] >= len(pattern) - 1:
        return i

    return -1

  def _zFunction(self, s: str) -> list[int]:
    """
    Returns the z array, where z[i] is the length of the longest prefix of
    s[i..n) which is also a prefix of s.

    https://cp-algorithms.com/string/z-function.html#implementation
    """
    n = len(s)
    z = [0] * n
    l = 0
    r = 0
    for i in range(1, n):
      if i < r:
        z[i] = min(r - i, z[i - l])
      while i + z[i] < n and s[z[i]] == s[i + z[i]]:
        z[i] += 1
      if i + z[i] > r:
        l = i
        r = i + z[i]
    return z

class Solution:
    def minStartingIndex(self, s: str, pattern: str) -> int:


You are an expert Python programmer. Write correct, efficient Python 3 code that solves the problem and passes all tests. Output the code in the following format: ```python
<code>
```

PROBLEM:
You are given a string word and a non-negative integer k.
Return the total number of substrings of word that contain every vowel ('a', 'e', 'i', 'o', and 'u') at least once and exactly k consonants.

Example 1:

Input: word = "aeioqq", k = 1
Output: 0
Explanation:
There is no substring with every vowel.

Example 2:

Input: word = "aeiou", k = 0
Output: 1
Explanation:
The only substring with every vowel and zero consonants is word[0..4], which is "aeiou".

Example 3:

Input: word = "ieaouqqieaouqq", k = 1
Output: 3
Explanation:
The substrings with every vowel and one consonant are:

word[0..5], which is "ieaouq".
word[6..11], which is "qieaou".
word[7..12], which is "ieaouq".

Constraints:

5 <= word.length <= 250
word consists only of lowercase English letters.
0 <= k <= word.length - 5

Your solution to the problem should be a method of the class Solution called countOfSubstrings and should pass all tests. Use the following starter code:
```python
class Solution:
    def countOfSubstrings(self, word: str, k: int) -> int:
        # Add your code here
```

SOLUTION:

Question:
PROBLEM:
You are given a string word and a non-negative integer k.
Return the total number of substrings of word that contain every vowel ('a', 'e', 'i', 'o', and 'u') at least once and exactly k consonants.

Example 1:

Input: word = "aeioqq", k = 1
Output: 0
Explanation:
There is no substring with every vowel.

Example 2:

Input: word = "aeiou", k = 0
Output: 1
Explanation:
The only substring with every vowel and zero consonants is word[0..4], which is "aeiou".

Example 3:

Input: word = "ieaouqqieaouqq", k = 1
Output: 3
Explanation:
The substrings with every vowel and one consonant are:

word[0..5], which is "ieaouq".
word[6..11], which is "qieaou".
word[7..12], which is "ieaouq".

Constraints:

5 <= word.length <= 250
word consists only of lowercase English letters.
0 <= k <= word.length - 5

Your solution to the problem should be a method of the class Solution called countOfSubstrings and should pass all tests. Use the following starter code:
```python
class Solution:
    def countOfSubstrings(self, word: str, k: int) -> int:
        # Add your code here
```

SOLUTION:

assert Solution().countOfSubstrings(word = "uuuaaeiooouueiiaaoou", k = 3) == 0

assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiou", k = 0) == 136

assert Solution().countOfSubstrings(word = "aeiouzzzzz", k = 5) == 1

assert Solution().countOfSubstrings(word = "aeioqq", k = 1) == 0

assert Solution().countOfSubstrings(word = "abcdefghijklmnopqrstuvwxyz", k = 5) == 0

assert Solution().countOfSubstrings(word = "abcdeaeiouxyz", k = 2) == 4

assert Solution().countOfSubstrings(word = "aieoubcdefg", k = 2) == 1

assert Solution().countOfSubstrings(word = "aeiouabcde", k = 2) == 2

assert Solution().countOfSubstrings(word = "aeiouaeiouaeiou", k = 3) == 0

assert Solution().countOfSubstrings(word = "bcdfghjklmnpqrstvwxyzaeiou", k = 5) == 1

assert Solution().countOfSubstrings(word = "aeiou", k = 0) == 1

assert Solution().countOfSubstrings(word = "abcdefghijklmnopqrstuvwxyz", k = 2) == 0

assert Solution().countOfSubstrings(word = "uaeiou", k = 0) == 3

assert Solution().countOfSubstrings(word = "aeioqz", k = 1) == 0

assert Solution().countOfSubstrings(word = "uuuuuaeiouuuuu", k = 4) == 0

assert Solution().countOfSubstrings(word = "aeiouaeiou", k = 0) == 21

assert Solution().countOfSubstrings(word = "zzzzzaeiou", k = 5) == 1

assert Solution().countOfSubstrings(word = "abcdefghijklmnopqrstuvwxyz", k = 10) == 0

assert Solution().countOfSubstrings(word = "aeiouaeiouaeiou", k = 0) == 66

assert Solution().countOfSubstrings(word = "aeiouaaa", k = 3) == 0

assert Solution().countOfSubstrings(word = "uoieaouiea", k = 0) == 20

assert Solution().countOfSubstrings(word = "uoiea", k = 0) == 1

assert Solution().countOfSubstrings(word = "voaiaoueeoiueoaiaioiouua", k = 4) == 0

assert Solution().countOfSubstrings(word = "uoieaaqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq", k = 5) == 1

assert Solution().countOfSubstrings(word = "ieaouqqieaouqq", k = 1) == 3

assert Solution().countOfSubstrings(word = "qwertyuiopasdfghjklzxcvbnmaeiou", k = 5) == 3

assert Solution().countOfSubstrings(word = "abcdefghijaeiouklmnopqrstuvwxyz", k = 10) == 14

assert Solution().countOfSubstrings(word = "uaieouaeiouaeiou", k = 2) == 0

assert Solution().countOfSubstrings(word = "aeiouqweuioaeiouaouieoiaeuoiaeuoiaeu", k = 7) == 0

assert Solution().countOfSubstrings(word = "aeiouqweaeiouasdfaeiouzxcvbnmaeiou", k = 8) == 22

assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 15) == 0

assert Solution().countOfSubstrings(word = "qwertyuiopasdfghjklzxcvbnmaeiouaeiouaeiou", k = 12) == 14

assert Solution().countOfSubstrings(word = "zxcvbnmlkjhgfdsapoiuytrewqaeiouaeiouaeiouaeiou", k = 12) == 23

assert Solution().countOfSubstrings(word = "qaeiouqaeiouqaeiouqaeiouqaeiou", k = 6) == 0

assert Solution().countOfSubstrings(word = "aeeeeiiioouuaeiouaeiou", k = 3) == 0

assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 20) == 0

assert Solution().countOfSubstrings(word = "zzzzzqqqaeiouzzzzzzqqqaeiouzzzzzz", k = 7) == 15

assert Solution().countOfSubstrings(word = "qzxcvbnmlkjhgfdsapoiuytrewqazxcvbnmlkjhgfdsapoiuytrew", k = 10) == 12

assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiou", k = 5) == 0

assert Solution().countOfSubstrings(word = "zebraaeiouxyzaeiouxyzaeiouxyzaeiou", k = 3) == 77

assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 15) == 0

assert Solution().countOfSubstrings(word = "aeiouaaaaaeiouuuuuuuueeeeeeeeiiooooooo", k = 5) == 0

assert Solution().countOfSubstrings(word = "aeiouzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", k = 10) == 1

assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 30) == 0

assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouqzxcvbnmqwertyuioplkjhgfd", k = 15) == 11

assert Solution().countOfSubstrings(word = "aeiouaouieoiaeuoiaeuoiaeu", k = 5) == 0

assert Solution().countOfSubstrings(word = "aeiouaeiouzzzzzzaeiouzzzzzaeiou", k = 4) == 12

assert Solution().countOfSubstrings(word = "uoieaqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq", k = 15) == 1

assert Solution().countOfSubstrings(word = "lkjhgfdwertyuiozxcvbnaeioumnopqrstaeiou", k = 11) == 23

assert Solution().countOfSubstrings(word = "aeiouzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", k = 1) == 1

assert Solution().countOfSubstrings(word = "aeiouaaaaaaaeeeeeooooouuuuuiiiiaaaaaaeiou", k = 7) == 0

assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 25) == 0

assert Solution().countOfSubstrings(word = "iaioiueoaoeuiaoeoieaoeueiaoeuiaoeuiaoeuiaoeuiaoeuiaoeuiaoeu", k = 8) == 0

assert Solution().countOfSubstrings(word = "voaiaoueeoiueoaiaioiouuaeuoieoiaioiouu", k = 8) == 0

assert Solution().countOfSubstrings(word = "aeiouzzzzz", k = 2) == 1

assert Solution().countOfSubstrings(word = "zzzzzzaeiouzzzzz", k = 1) == 2

assert Solution().countOfSubstrings(word = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzaeiou", k = 20) == 1

assert Solution().countOfSubstrings(word = "uaieoaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 5) == 0

assert Solution().countOfSubstrings(word = "vowelsaeiouconsonantsaeiou", k = 2) == 6

assert Solution().countOfSubstrings(word = "aeioubcdfgheiklmnoqprstuvwxyz", k = 10) == 2

assert Solution().countOfSubstrings(word = "aeiouaouieoiaeuoiaeuoiaeuqwertyuiopasdfghjklzxcvbnm", k = 20) == 27

assert Solution().countOfSubstrings(word = "aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaeiou", k = 6) == 1

assert Solution().countOfSubstrings(word = "lkjhgfdsapoiuytrewqaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 20) == 0

assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 30) == 0

assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu", k = 25) == 0

assert Solution().countOfSubstrings(word = "aaaaaaeiouuuuuuaeiouuuuuuaeiouuuuuuaeiouuuuuu", k = 20) == 0

assert Solution().countOfSubstrings(word = "aeiouxyzaeiouxyzaeiouxyzaeiouxyzaeiouxyz", k = 10) == 21

Answer: assert Solution().countOfSubstrings(word = "uuuaaeiooouueiiaaoou", k = 3) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiou", k = 0) == 136

Answer: assert Solution().countOfSubstrings(word = "aeiouzzzzz", k = 5) == 1

Answer: assert Solution().countOfSubstrings(word = "aeioqq", k = 1) == 0

Answer: assert Solution().countOfSubstrings(word = "abcdefghijklmnopqrstuvwxyz", k = 5) == 0

Answer: assert Solution().countOfSubstrings(word = "abcdeaeiouxyz", k = 2) == 4

Answer: assert Solution().countOfSubstrings(word = "aieoubcdefg", k = 2) == 1

Answer: assert Solution().countOfSubstrings(word = "aeiouabcde", k = 2) == 2

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouaeiou", k = 3) == 0

Answer: assert Solution().countOfSubstrings(word = "bcdfghjklmnpqrstvwxyzaeiou", k = 5) == 1

Answer: assert Solution().countOfSubstrings(word = "aeiou", k = 0) == 1

Answer: assert Solution().countOfSubstrings(word = "abcdefghijklmnopqrstuvwxyz", k = 2) == 0

Answer: assert Solution().countOfSubstrings(word = "uaeiou", k = 0) == 3

Answer: assert Solution().countOfSubstrings(word = "aeioqz", k = 1) == 0

Answer: assert Solution().countOfSubstrings(word = "uuuuuaeiouuuuu", k = 4) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiou", k = 0) == 21

Answer: assert Solution().countOfSubstrings(word = "zzzzzaeiou", k = 5) == 1

Answer: assert Solution().countOfSubstrings(word = "abcdefghijklmnopqrstuvwxyz", k = 10) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouaeiou", k = 0) == 66

Answer: assert Solution().countOfSubstrings(word = "aeiouaaa", k = 3) == 0

Answer: assert Solution().countOfSubstrings(word = "uoieaouiea", k = 0) == 20

Answer: assert Solution().countOfSubstrings(word = "uoiea", k = 0) == 1

Answer: assert Solution().countOfSubstrings(word = "voaiaoueeoiueoaiaioiouua", k = 4) == 0

Answer: assert Solution().countOfSubstrings(word = "uoieaaqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq", k = 5) == 1

Answer: assert Solution().countOfSubstrings(word = "ieaouqqieaouqq", k = 1) == 3

Answer: assert Solution().countOfSubstrings(word = "qwertyuiopasdfghjklzxcvbnmaeiou", k = 5) == 3

Answer: assert Solution().countOfSubstrings(word = "abcdefghijaeiouklmnopqrstuvwxyz", k = 10) == 14

Answer: assert Solution().countOfSubstrings(word = "uaieouaeiouaeiou", k = 2) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouqweuioaeiouaouieoiaeuoiaeuoiaeu", k = 7) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouqweaeiouasdfaeiouzxcvbnmaeiou", k = 8) == 22

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 15) == 0

Answer: assert Solution().countOfSubstrings(word = "qwertyuiopasdfghjklzxcvbnmaeiouaeiouaeiou", k = 12) == 14

Answer: assert Solution().countOfSubstrings(word = "zxcvbnmlkjhgfdsapoiuytrewqaeiouaeiouaeiouaeiou", k = 12) == 23

Answer: assert Solution().countOfSubstrings(word = "qaeiouqaeiouqaeiouqaeiouqaeiou", k = 6) == 0

Answer: assert Solution().countOfSubstrings(word = "aeeeeiiioouuaeiouaeiou", k = 3) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 20) == 0

Answer: assert Solution().countOfSubstrings(word = "zzzzzqqqaeiouzzzzzzqqqaeiouzzzzzz", k = 7) == 15

Answer: assert Solution().countOfSubstrings(word = "qzxcvbnmlkjhgfdsapoiuytrewqazxcvbnmlkjhgfdsapoiuytrew", k = 10) == 12

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiou", k = 5) == 0

Answer: assert Solution().countOfSubstrings(word = "zebraaeiouxyzaeiouxyzaeiouxyzaeiou", k = 3) == 77

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 15) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouaaaaaeiouuuuuuuueeeeeeeeiiooooooo", k = 5) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", k = 10) == 1

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 30) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouqzxcvbnmqwertyuioplkjhgfd", k = 15) == 11

Answer: assert Solution().countOfSubstrings(word = "aeiouaouieoiaeuoiaeuoiaeu", k = 5) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouzzzzzzaeiouzzzzzaeiou", k = 4) == 12

Answer: assert Solution().countOfSubstrings(word = "uoieaqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq", k = 15) == 1

Answer: assert Solution().countOfSubstrings(word = "lkjhgfdwertyuiozxcvbnaeioumnopqrstaeiou", k = 11) == 23

Answer: assert Solution().countOfSubstrings(word = "aeiouzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", k = 1) == 1

Answer: assert Solution().countOfSubstrings(word = "aeiouaaaaaaaeeeeeooooouuuuuiiiiaaaaaaeiou", k = 7) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 25) == 0

Answer: assert Solution().countOfSubstrings(word = "iaioiueoaoeuiaoeoieaoeueiaoeuiaoeuiaoeuiaoeuiaoeuiaoeuiaoeu", k = 8) == 0

Answer: assert Solution().countOfSubstrings(word = "voaiaoueeoiueoaiaioiouuaeuoieoiaioiouu", k = 8) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouzzzzz", k = 2) == 1

Answer: assert Solution().countOfSubstrings(word = "zzzzzzaeiouzzzzz", k = 1) == 2

Answer: assert Solution().countOfSubstrings(word = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzaeiou", k = 20) == 1

Answer: assert Solution().countOfSubstrings(word = "uaieoaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 5) == 0

Answer: assert Solution().countOfSubstrings(word = "vowelsaeiouconsonantsaeiou", k = 2) == 6

Answer: assert Solution().countOfSubstrings(word = "aeioubcdfgheiklmnoqprstuvwxyz", k = 10) == 2

Answer: assert Solution().countOfSubstrings(word = "aeiouaouieoiaeuoiaeuoiaeuqwertyuiopasdfghjklzxcvbnm", k = 20) == 27

Answer: assert Solution().countOfSubstrings(word = "aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzzaeiou", k = 6) == 1

Answer: assert Solution().countOfSubstrings(word = "lkjhgfdsapoiuytrewqaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 20) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 30) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu", k = 25) == 0

Answer: assert Solution().countOfSubstrings(word = "aaaaaaeiouuuuuuaeiouuuuuuaeiouuuuuuaeiouuuuuu", k = 20) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouxyzaeiouxyzaeiouxyzaeiouxyzaeiouxyz", k = 10) == 21

import random
import functools
import collections
import string
import math
import datetime

from typing import *
from functools import *
from collections import *
from itertools import *
from heapq import *
from bisect import *
from string import *
from operator import *
from math import *

inf = float('inf')

class ListNode:
    def __init__(self, val=0, next=None):
        self.val = val
        self.next = next

def list_node(values: list):
    if not values:
        return None
    head = ListNode(values[0])
    p = head
    for val in values[1:]:
        node = ListNode(val)
        p.next = node
        p = node
    return head

def is_same_list(p1, p2):
    if p1 is None and p2 is None:
        return True
    if not p1 or not p2:
        return False
    return p1.val == p2.val and is_same_list(p1.next, p2.next)

class TreeNode:
    def __init__(self, val=0, left=None, right=None):
        self.val = val
        self.left = left
        self.right = right

def tree_node(values: list):
    if not values:
        return None
    root = TreeNode(values[0])
    i = 1
    queue = deque()
    queue.append(root)
    while queue:
        node = queue.popleft()
        if i < len(values) and values[i] is not None:
            node.left = TreeNode(values[i])
            queue.append(node.left)
        i += 1
        if i < len(values) and values[i] is not None:
            node.right = TreeNode(values[i])
            queue.append(node.right)
        i += 1
    return root

def is_same_tree(p, q):
    if not p and not q:
        return True
    elif not p or not q:
        return False
    elif p.val != q.val:
        return False
    else:
        return is_same_tree(p.left, q.left) and is_same_tree(p.right, q.right)

class Solution:
    def countOfSubstrings(self, word: str, k: int) -> int:
        def f(k: int) -> int:
            cnt = Counter()
            ans = l = x = 0
            for c in word:
                if c in "aeiou":
                    cnt[c] += 1
                else:
                    x += 1
                while x >= k and len(cnt) == 5:
                    d = word[l]
                    if d in "aeiou":
                        cnt[d] -= 1
                        if cnt[d] == 0:
                            cnt.pop(d)
                    else:
                        x -= 1
                    l += 1
                ans += l
            return ans

        return f(k) - f(k + 1)


You are an expert Python programmer. Write correct, efficient Python 3 code that solves the problem and passes all tests. Output the code in the following format: ```python
<code>
```

PROBLEM:
You are given a string word and a non-negative integer k.
Return the total number of substrings of word that contain every vowel ('a', 'e', 'i', 'o', and 'u') at least once and exactly k consonants.

Example 1:

Input: word = "aeioqq", k = 1
Output: 0
Explanation:
There is no substring with every vowel.

Example 2:

Input: word = "aeiou", k = 0
Output: 1
Explanation:
The only substring with every vowel and zero consonants is word[0..4], which is "aeiou".

Example 3:

Input: word = "ieaouqqieaouqq", k = 1
Output: 3
Explanation:
The substrings with every vowel and one consonant are:

word[0..5], which is "ieaouq".
word[6..11], which is "qieaou".
word[7..12], which is "ieaouq".

Constraints:

5 <= word.length <= 2 * 105
word consists only of lowercase English letters.
0 <= k <= word.length - 5

Your solution to the problem should be a method of the class Solution called countOfSubstrings and should pass all tests. Use the following starter code:
```python
class Solution:
    def countOfSubstrings(self, word: str, k: int) -> int:
        # Add your code here
```

SOLUTION:

Question:
PROBLEM:
You are given a string word and a non-negative integer k.
Return the total number of substrings of word that contain every vowel ('a', 'e', 'i', 'o', and 'u') at least once and exactly k consonants.

Example 1:

Input: word = "aeioqq", k = 1
Output: 0
Explanation:
There is no substring with every vowel.

Example 2:

Input: word = "aeiou", k = 0
Output: 1
Explanation:
The only substring with every vowel and zero consonants is word[0..4], which is "aeiou".

Example 3:

Input: word = "ieaouqqieaouqq", k = 1
Output: 3
Explanation:
The substrings with every vowel and one consonant are:

word[0..5], which is "ieaouq".
word[6..11], which is "qieaou".
word[7..12], which is "ieaouq".

Constraints:

5 <= word.length <= 2 * 105
word consists only of lowercase English letters.
0 <= k <= word.length - 5

Your solution to the problem should be a method of the class Solution called countOfSubstrings and should pass all tests. Use the following starter code:
```python
class Solution:
    def countOfSubstrings(self, word: str, k: int) -> int:
        # Add your code here
```

SOLUTION:

assert Solution().countOfSubstrings(word = "qwertyuiopasdfghjklzxcvbnmaeiou", k = 10) == 4

assert Solution().countOfSubstrings(word = "uoieaouoieaouoieaouoieaoiueaouieaouieaouieao", k = 4) == 0

assert Solution().countOfSubstrings(word = "aeiouzzzzz", k = 5) == 1

assert Solution().countOfSubstrings(word = "aeioqq", k = 1) == 0

assert Solution().countOfSubstrings(word = "abcdefghijklmnopqrstuvwxyz", k = 5) == 0

assert Solution().countOfSubstrings(word = "aaaaaeeeeiiioooouuuu", k = 0) == 20

assert Solution().countOfSubstrings(word = "aeiou", k = 0) == 1

assert Solution().countOfSubstrings(word = "abcdefghijklmnopqrstuvwxyz", k = 2) == 0

assert Solution().countOfSubstrings(word = "uuuuuaeiouuuuuu", k = 3) == 0

assert Solution().countOfSubstrings(word = "abcdefghijklmnopqrstuvwxyz", k = 3) == 0

assert Solution().countOfSubstrings(word = "uuiiooeaa", k = 2) == 0

assert Solution().countOfSubstrings(word = "aeiouaeiou", k = 1) == 0

assert Solution().countOfSubstrings(word = "aaaaaeeeeeeiiiiioooooouuuuuu", k = 5) == 0

assert Solution().countOfSubstrings(word = "aeiouaeiouaeiou", k = 2) == 0

assert Solution().countOfSubstrings(word = "aeeiiouu", k = 0) == 2

assert Solution().countOfSubstrings(word = "uaeiouaeiouaeeioouioiaeaou", k = 3) == 0

assert Solution().countOfSubstrings(word = "aeiaeaouaeiou", k = 2) == 0

assert Solution().countOfSubstrings(word = "zzzaeiouzzz", k = 3) == 4

assert Solution().countOfSubstrings(word = "uuuuuaeiouuuuu", k = 2) == 0

assert Solution().countOfSubstrings(word = "abcdefghijklmnopqrstuvwxyz", k = 20) == 1

assert Solution().countOfSubstrings(word = "uoiea", k = 0) == 1

assert Solution().countOfSubstrings(word = "ieaouqqieaouqq", k = 1) == 3

assert Solution().countOfSubstrings(word = "aeiaaioeaou", k = 1) == 0

assert Solution().countOfSubstrings(word = "aeiouaeiou", k = 2) == 0

assert Solution().countOfSubstrings(word = "aeiouzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", k = 3) == 1

assert Solution().countOfSubstrings(word = "vwxyzaeiouvwxyz", k = 3) == 4

assert Solution().countOfSubstrings(word = "bcdfgahijklmnopqrstuevwxyoz", k = 10) == 0

assert Solution().countOfSubstrings(word = "abcdefghijklaeioumnopqrstuvw", k = 15) == 7

assert Solution().countOfSubstrings(word = "aeiouzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzaeiou", k = 10) == 2

assert Solution().countOfSubstrings(word = "aeiouzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", k = 0) == 1

assert Solution().countOfSubstrings(word = "aeiouabcdeiouaeioufghijaeiouklmnoaeiou", k = 7) == 61

assert Solution().countOfSubstrings(word = "eiouaieouaieouaieouaieouaieouaieouaieouaieouaieou", k = 2) == 0

assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 10) == 0

assert Solution().countOfSubstrings(word = "uoieaouieaouieaouieaouieaouieaouieaouieaouieaouieaouieaouieaouieao", k = 0) == 1952

assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 5) == 0

assert Solution().countOfSubstrings(word = "aeioubcdfghijklmnopqrstuvwxyz", k = 20) == 1

assert Solution().countOfSubstrings(word = "aeiouabcde", k = 2) == 2

assert Solution().countOfSubstrings(word = "uoieaouieaouieaouieaouieaouieaouieaouieaouieaouieaouieaouieaouieao", k = 20) == 0

assert Solution().countOfSubstrings(word = "aeiouaaaaaeiouaaaaaeiouaaaaaeiouaaaaaeiouaaaaaeiou", k = 5) == 0

assert Solution().countOfSubstrings(word = "aeiouuioeuaoieuaeiou", k = 0) == 117

assert Solution().countOfSubstrings(word = "uoieaouoieaouoieaouoieaoiueaouieaouieaouieao", k = 10) == 0

assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 0) == 666

assert Solution().countOfSubstrings(word = "bcdfgqqqqqqqqqaeiouqqqqqqqqqbcdfgqqqqqqqqqaeiou", k = 5) == 7

assert Solution().countOfSubstrings(word = "aaaeeeeiiioouuuuaaaeeeeiiioouuuuaaaeeeeiiioouuuu", k = 10) == 0

assert Solution().countOfSubstrings(word = "abcdefghijaeiouklmnopqrstuvwxyz", k = 5) == 10

assert Solution().countOfSubstrings(word = "qazwsxedcrfvtgbyhnujmikolpaeiouaeiou", k = 8) == 9

assert Solution().countOfSubstrings(word = "aeiouzzzzzzzzzzzzzzzzzzzzzzzzzz", k = 0) == 1

assert Solution().countOfSubstrings(word = "aueioayuieoayuieoayuieoayuieoayuieoay", k = 3) == 120

assert Solution().countOfSubstrings(word = "aeiouzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", k = 0) == 1

assert Solution().countOfSubstrings(word = "aeiouabcdefghijklmnopqrstuvwxyzaeiou", k = 15) == 12

assert Solution().countOfSubstrings(word = "xyzabcdeaeiouaeiouaeiouaeiouxyz", k = 3) == 51

assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 5) == 0

assert Solution().countOfSubstrings(word = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", k = 15) == 0

assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiou", k = 0) == 231

assert Solution().countOfSubstrings(word = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", k = 0) == 0

assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 0) == 1596

assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiou", k = 3) == 0

assert Solution().countOfSubstrings(word = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzaeiou", k = 0) == 1

assert Solution().countOfSubstrings(word = "aeioaeioaeioaeioaeiouuuoieaouieaoieaouieaoieaouieaoieaoieaouieao", k = 7) == 0

assert Solution().countOfSubstrings(word = "zxcvbnmlkjhgfdsapoiuytrewqaeiouqwertyuiopasdfghjklzxcvbnmaeiou", k = 15) == 42

assert Solution().countOfSubstrings(word = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", k = 20) == 43

assert Solution().countOfSubstrings(word = "ieaouqqieaouqqieaouqqieaouqqieaouqqieaouqqieaouqq", k = 2) == 133

assert Solution().countOfSubstrings(word = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", k = 10) == 0

assert Solution().countOfSubstrings(word = "zzzzzaeiouzzzzzzzz", k = 5) == 6

assert Solution().countOfSubstrings(word = "zzzzzuaaaaaeeeeiiioouuuuuuaaaaaeeeeiiioouuuuuu", k = 5) == 28

assert Solution().countOfSubstrings(word = "ieaouqieaouqieaouqieaouqieaouqieaouqieaouqieaouqieaouqieaouqieaouq", k = 3) == 294

assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", k = 10) == 11

assert Solution().countOfSubstrings(word = "qweqrtyuiopasdlkjfhgyxcvbnmaeiouqwertyuiopaesd", k = 8) == 23

Answer: assert Solution().countOfSubstrings(word = "qwertyuiopasdfghjklzxcvbnmaeiou", k = 10) == 4

Answer: assert Solution().countOfSubstrings(word = "uoieaouoieaouoieaouoieaoiueaouieaouieaouieao", k = 4) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouzzzzz", k = 5) == 1

Answer: assert Solution().countOfSubstrings(word = "aeioqq", k = 1) == 0

Answer: assert Solution().countOfSubstrings(word = "abcdefghijklmnopqrstuvwxyz", k = 5) == 0

Answer: assert Solution().countOfSubstrings(word = "aaaaaeeeeiiioooouuuu", k = 0) == 20

Answer: assert Solution().countOfSubstrings(word = "aeiou", k = 0) == 1

Answer: assert Solution().countOfSubstrings(word = "abcdefghijklmnopqrstuvwxyz", k = 2) == 0

Answer: assert Solution().countOfSubstrings(word = "uuuuuaeiouuuuuu", k = 3) == 0

Answer: assert Solution().countOfSubstrings(word = "abcdefghijklmnopqrstuvwxyz", k = 3) == 0

Answer: assert Solution().countOfSubstrings(word = "uuiiooeaa", k = 2) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiou", k = 1) == 0

Answer: assert Solution().countOfSubstrings(word = "aaaaaeeeeeeiiiiioooooouuuuuu", k = 5) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouaeiou", k = 2) == 0

Answer: assert Solution().countOfSubstrings(word = "aeeiiouu", k = 0) == 2

Answer: assert Solution().countOfSubstrings(word = "uaeiouaeiouaeeioouioiaeaou", k = 3) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiaeaouaeiou", k = 2) == 0

Answer: assert Solution().countOfSubstrings(word = "zzzaeiouzzz", k = 3) == 4

Answer: assert Solution().countOfSubstrings(word = "uuuuuaeiouuuuu", k = 2) == 0

Answer: assert Solution().countOfSubstrings(word = "abcdefghijklmnopqrstuvwxyz", k = 20) == 1

Answer: assert Solution().countOfSubstrings(word = "uoiea", k = 0) == 1

Answer: assert Solution().countOfSubstrings(word = "ieaouqqieaouqq", k = 1) == 3

Answer: assert Solution().countOfSubstrings(word = "aeiaaioeaou", k = 1) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiou", k = 2) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", k = 3) == 1

Answer: assert Solution().countOfSubstrings(word = "vwxyzaeiouvwxyz", k = 3) == 4

Answer: assert Solution().countOfSubstrings(word = "bcdfgahijklmnopqrstuevwxyoz", k = 10) == 0

Answer: assert Solution().countOfSubstrings(word = "abcdefghijklaeioumnopqrstuvw", k = 15) == 7

Answer: assert Solution().countOfSubstrings(word = "aeiouzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzaeiou", k = 10) == 2

Answer: assert Solution().countOfSubstrings(word = "aeiouzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", k = 0) == 1

Answer: assert Solution().countOfSubstrings(word = "aeiouabcdeiouaeioufghijaeiouklmnoaeiou", k = 7) == 61

Answer: assert Solution().countOfSubstrings(word = "eiouaieouaieouaieouaieouaieouaieouaieouaieouaieou", k = 2) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 10) == 0

Answer: assert Solution().countOfSubstrings(word = "uoieaouieaouieaouieaouieaouieaouieaouieaouieaouieaouieaouieaouieao", k = 0) == 1952

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 5) == 0

Answer: assert Solution().countOfSubstrings(word = "aeioubcdfghijklmnopqrstuvwxyz", k = 20) == 1

Answer: assert Solution().countOfSubstrings(word = "aeiouabcde", k = 2) == 2

Answer: assert Solution().countOfSubstrings(word = "uoieaouieaouieaouieaouieaouieaouieaouieaouieaouieaouieaouieaouieao", k = 20) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouaaaaaeiouaaaaaeiouaaaaaeiouaaaaaeiouaaaaaeiou", k = 5) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouuioeuaoieuaeiou", k = 0) == 117

Answer: assert Solution().countOfSubstrings(word = "uoieaouoieaouoieaouoieaoiueaouieaouieaouieao", k = 10) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 0) == 666

Answer: assert Solution().countOfSubstrings(word = "bcdfgqqqqqqqqqaeiouqqqqqqqqqbcdfgqqqqqqqqqaeiou", k = 5) == 7

Answer: assert Solution().countOfSubstrings(word = "aaaeeeeiiioouuuuaaaeeeeiiioouuuuaaaeeeeiiioouuuu", k = 10) == 0

Answer: assert Solution().countOfSubstrings(word = "abcdefghijaeiouklmnopqrstuvwxyz", k = 5) == 10

Answer: assert Solution().countOfSubstrings(word = "qazwsxedcrfvtgbyhnujmikolpaeiouaeiou", k = 8) == 9

Answer: assert Solution().countOfSubstrings(word = "aeiouzzzzzzzzzzzzzzzzzzzzzzzzzz", k = 0) == 1

Answer: assert Solution().countOfSubstrings(word = "aueioayuieoayuieoayuieoayuieoayuieoay", k = 3) == 120

Answer: assert Solution().countOfSubstrings(word = "aeiouzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", k = 0) == 1

Answer: assert Solution().countOfSubstrings(word = "aeiouabcdefghijklmnopqrstuvwxyzaeiou", k = 15) == 12

Answer: assert Solution().countOfSubstrings(word = "xyzabcdeaeiouaeiouaeiouaeiouxyz", k = 3) == 51

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 5) == 0

Answer: assert Solution().countOfSubstrings(word = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", k = 15) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiou", k = 0) == 231

Answer: assert Solution().countOfSubstrings(word = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", k = 0) == 0

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiouaeiou", k = 0) == 1596

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouaeiou", k = 3) == 0

Answer: assert Solution().countOfSubstrings(word = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzaeiou", k = 0) == 1

Answer: assert Solution().countOfSubstrings(word = "aeioaeioaeioaeioaeiouuuoieaouieaoieaouieaoieaouieaoieaoieaouieao", k = 7) == 0

Answer: assert Solution().countOfSubstrings(word = "zxcvbnmlkjhgfdsapoiuytrewqaeiouqwertyuiopasdfghjklzxcvbnmaeiou", k = 15) == 42

Answer: assert Solution().countOfSubstrings(word = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", k = 20) == 43

Answer: assert Solution().countOfSubstrings(word = "ieaouqqieaouqqieaouqqieaouqqieaouqqieaouqqieaouqq", k = 2) == 133

Answer: assert Solution().countOfSubstrings(word = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", k = 10) == 0

Answer: assert Solution().countOfSubstrings(word = "zzzzzaeiouzzzzzzzz", k = 5) == 6

Answer: assert Solution().countOfSubstrings(word = "zzzzzuaaaaaeeeeiiioouuuuuuaaaaaeeeeiiioouuuuuu", k = 5) == 28

Answer: assert Solution().countOfSubstrings(word = "ieaouqieaouqieaouqieaouqieaouqieaouqieaouqieaouqieaouqieaouqieaouq", k = 3) == 294

Answer: assert Solution().countOfSubstrings(word = "aeiouaeiouaeiouzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz", k = 10) == 11

Answer: assert Solution().countOfSubstrings(word = "qweqrtyuiopasdlkjfhgyxcvbnmaeiouqwertyuiopaesd", k = 8) == 23

import random
import functools
import collections
import string
import math
import datetime

from typing import *
from functools import *
from collections import *
from itertools import *
from heapq import *
from bisect import *
from string import *
from operator import *
from math import *

inf = float('inf')

class ListNode:
    def __init__(self, val=0, next=None):
        self.val = val
        self.next = next

def list_node(values: list):
    if not values:
        return None
    head = ListNode(values[0])
    p = head
    for val in values[1:]:
        node = ListNode(val)
        p.next = node
        p = node
    return head

def is_same_list(p1, p2):
    if p1 is None and p2 is None:
        return True
    if not p1 or not p2:
        return False
    return p1.val == p2.val and is_same_list(p1.next, p2.next)

class TreeNode:
    def __init__(self, val=0, left=None, right=None):
        self.val = val
        self.left = left
        self.right = right

def tree_node(values: list):
    if not values:
        return None
    root = TreeNode(values[0])
    i = 1
    queue = deque()
    queue.append(root)
    while queue:
        node = queue.popleft()
        if i < len(values) and values[i] is not None:
            node.left = TreeNode(values[i])
            queue.append(node.left)
        i += 1
        if i < len(values) and values[i] is not None:
            node.right = TreeNode(values[i])
            queue.append(node.right)
        i += 1
    return root

def is_same_tree(p, q):
    if not p and not q:
        return True
    elif not p or not q:
        return False
    elif p.val != q.val:
        return False
    else:
        return is_same_tree(p.left, q.left) and is_same_tree(p.right, q.right)

class Solution:
    def countOfSubstrings(self, word: str, k: int) -> int:
        def f(k: int) -> int:
            cnt = Counter()
            ans = l = x = 0
            for c in word:
                if c in "aeiou":
                    cnt[c] += 1
                else:
                    x += 1
                while x >= k and len(cnt) == 5:
                    d = word[l]
                    if d in "aeiou":
                        cnt[d] -= 1
                        if cnt[d] == 0:
                            cnt.pop(d)
                    else:
                        x -= 1
                    l += 1
                ans += l
            return ans

        return f(k) - f(k + 1)


You are an expert Python programmer. Write correct, efficient Python 3 code that solves the problem and passes all tests. Output the code in the following format: ```python
<code>
```

PROBLEM:
You are given an array of integers nums of size 3.
Return the maximum possible number whose binary representation can be formed by concatenating the binary representation of all elements in nums in some order.
Note that the binary representation of any number does not contain leading zeros.

Example 1:

Input: nums = [1,2,3]
Output: 30
Explanation:
Concatenate the numbers in the order [3, 1, 2] to get the result "11110", which is the binary representation of 30.

Example 2:

Input: nums = [2,8,16]
Output: 1296
Explanation:
Concatenate the numbers in the order [2, 8, 16] to get the result "10100010000", which is the binary representation of 1296.

Constraints:

nums.length == 3
1 <= nums[i] <= 127

Your solution to the problem should be a method of the class Solution called maxGoodNumber and should pass all tests. Use the following starter code:
```python
class Solution:
    def maxGoodNumber(self, nums: List[int]) -> int:
        # Add your code here
```

SOLUTION:

Question:
PROBLEM:
You are given an array of integers nums of size 3.
Return the maximum possible number whose binary representation can be formed by concatenating the binary representation of all elements in nums in some order.
Note that the binary representation of any number does not contain leading zeros.

Example 1:

Input: nums = [1,2,3]
Output: 30
Explanation:
Concatenate the numbers in the order [3, 1, 2] to get the result "11110", which is the binary representation of 30.

Example 2:

Input: nums = [2,8,16]
Output: 1296
Explanation:
Concatenate the numbers in the order [2, 8, 16] to get the result "10100010000", which is the binary representation of 1296.

Constraints:

nums.length == 3
1 <= nums[i] <= 127

Your solution to the problem should be a method of the class Solution called maxGoodNumber and should pass all tests. Use the following starter code:
```python
class Solution:
    def maxGoodNumber(self, nums: List[int]) -> int:
        # Add your code here
```

SOLUTION:

assert Solution().maxGoodNumber(nums = [64,1,127]) == 32704

assert Solution().maxGoodNumber(nums = [7,5,3]) == 253

assert Solution().maxGoodNumber(nums = [127,127,127]) == 2097151

assert Solution().maxGoodNumber(nums = [32,16,8]) == 17440

assert Solution().maxGoodNumber(nums = [1,5,7]) == 125

assert Solution().maxGoodNumber(nums = [64,32,16]) == 135232

assert Solution().maxGoodNumber(nums = [1,2,3]) == 30

assert Solution().maxGoodNumber(nums = [2,8,16]) == 1296

assert Solution().maxGoodNumber(nums = [1,1,1]) == 7

assert Solution().maxGoodNumber(nums = [127,64,32]) == 1044544

assert Solution().maxGoodNumber(nums = [3,4,126]) == 4084

assert Solution().maxGoodNumber(nums = [127,1,1]) == 511

assert Solution().maxGoodNumber(nums = [15, 31, 63]) == 32767

assert Solution().maxGoodNumber(nums = [64, 32, 16]) == 135232

assert Solution().maxGoodNumber(nums = [99, 66, 33]) == 815298

assert Solution().maxGoodNumber(nums = [63, 1, 127]) == 16383

assert Solution().maxGoodNumber(nums = [8, 4, 2]) == 328

assert Solution().maxGoodNumber(nums = [110, 111, 112]) == 1849326

assert Solution().maxGoodNumber(nums = [5, 10, 15]) == 2010

assert Solution().maxGoodNumber(nums = [63, 31, 15]) == 32767

assert Solution().maxGoodNumber(nums = [50, 60, 70]) == 497990

assert Solution().maxGoodNumber(nums = [63,15,31]) == 32767

assert Solution().maxGoodNumber(nums = [4,16,8]) == 2320

assert Solution().maxGoodNumber(nums = [55, 25, 10]) == 28570

assert Solution().maxGoodNumber(nums = [10,200,30]) == 126090

assert Solution().maxGoodNumber(nums = [127, 1, 127]) == 32767

assert Solution().maxGoodNumber(nums = [7, 7, 7]) == 511

assert Solution().maxGoodNumber(nums = [7,5,9]) == 985

assert Solution().maxGoodNumber(nums = [21, 42, 84]) == 177492

assert Solution().maxGoodNumber(nums = [64, 1, 127]) == 32704

assert Solution().maxGoodNumber(nums = [1, 2, 4]) == 52

assert Solution().maxGoodNumber(nums = [60, 61, 62]) == 257916

assert Solution().maxGoodNumber(nums = [1, 4, 8]) == 200

assert Solution().maxGoodNumber(nums = [3, 9, 27]) == 1977

assert Solution().maxGoodNumber(nums = [8, 16, 32]) == 17440

assert Solution().maxGoodNumber(nums = [100,20,30]) == 126100

assert Solution().maxGoodNumber(nums = [63, 64, 65]) == 1040576

assert Solution().maxGoodNumber(nums = [15, 31, 127]) == 65535

assert Solution().maxGoodNumber(nums = [10, 15, 20]) == 8020

assert Solution().maxGoodNumber(nums = [1, 4, 2]) == 52

assert Solution().maxGoodNumber(nums = [99,100,101]) == 1667683

assert Solution().maxGoodNumber(nums = [7, 14, 28]) == 4060

assert Solution().maxGoodNumber(nums = [6, 12, 24]) == 3480

assert Solution().maxGoodNumber(nums = [10, 20, 30]) == 15700

assert Solution().maxGoodNumber(nums = [9, 5, 7]) == 985

assert Solution().maxGoodNumber(nums = [63, 15, 7]) == 8191

assert Solution().maxGoodNumber(nums = [6,12,24]) == 3480

assert Solution().maxGoodNumber(nums = [31, 30, 29]) == 32733

assert Solution().maxGoodNumber(nums = [126, 125, 124]) == 2080508

assert Solution().maxGoodNumber(nums = [101, 56, 29]) == 244837

assert Solution().maxGoodNumber(nums = [45, 30, 60]) == 126765

assert Solution().maxGoodNumber(nums = [127, 64, 32]) == 1044544

assert Solution().maxGoodNumber(nums = [1, 127, 64]) == 32704

assert Solution().maxGoodNumber(nums = [63, 7, 2]) == 2046

assert Solution().maxGoodNumber(nums = [11, 22, 44]) == 23980

assert Solution().maxGoodNumber(nums = [111, 44, 88]) == 915032

assert Solution().maxGoodNumber(nums = [123,45,67]) == 1013443

assert Solution().maxGoodNumber(nums = [85, 17, 34]) == 175202

assert Solution().maxGoodNumber(nums = [15, 14, 13]) == 4077

assert Solution().maxGoodNumber(nums = [5, 10, 20]) == 2900

assert Solution().maxGoodNumber(nums = [100, 50, 75]) == 832075

assert Solution().maxGoodNumber(nums = [5, 7, 9]) == 985

assert Solution().maxGoodNumber(nums = [45, 44, 43]) == 187179

assert Solution().maxGoodNumber(nums = [3, 6, 9]) == 489

assert Solution().maxGoodNumber(nums = [3,6,9]) == 489

assert Solution().maxGoodNumber(nums = [12, 15, 9]) == 4041

assert Solution().maxGoodNumber(nums = [63, 32, 16]) == 130080

assert Solution().maxGoodNumber(nums = [120, 96, 64]) == 1978432

assert Solution().maxGoodNumber(nums = [100, 50, 25]) == 211300

assert Solution().maxGoodNumber(nums = [63, 126, 96]) == 1048416

assert Solution().maxGoodNumber(nums = [1, 1, 1]) == 7

assert Solution().maxGoodNumber(nums = [126, 63, 31]) == 262142

assert Solution().maxGoodNumber(nums = [31, 3, 15]) == 2047

assert Solution().maxGoodNumber(nums = [120, 121, 122]) == 2014456

assert Solution().maxGoodNumber(nums = [99, 65, 32]) == 815200

assert Solution().maxGoodNumber(nums = [99, 88, 77]) == 1633357

assert Solution().maxGoodNumber(nums = [120, 124, 126]) == 2080376

assert Solution().maxGoodNumber(nums = [100, 99, 101]) == 1667683

assert Solution().maxGoodNumber(nums = [127, 1, 2]) == 1022

assert Solution().maxGoodNumber(nums = [7, 5, 9]) == 985

assert Solution().maxGoodNumber(nums = [80, 81, 82]) == 1353936

assert Solution().maxGoodNumber(nums = [9, 18, 27]) == 14130

assert Solution().maxGoodNumber(nums = [1,127,64]) == 32704

assert Solution().maxGoodNumber(nums = [10, 15, 3]) == 1018

assert Solution().maxGoodNumber(nums = [31, 15, 7]) == 4095

assert Solution().maxGoodNumber(nums = [30, 20, 10]) == 15700

assert Solution().maxGoodNumber(nums = [5, 9, 3]) == 473

assert Solution().maxGoodNumber(nums = [23, 45, 67]) == 194243

assert Solution().maxGoodNumber(nums = [73, 28, 14]) == 61001

assert Solution().maxGoodNumber(nums = [77, 22, 88]) == 371789

assert Solution().maxGoodNumber(nums = [60, 30, 15]) == 32700

Answer: assert Solution().maxGoodNumber(nums = [64,1,127]) == 32704

Answer: assert Solution().maxGoodNumber(nums = [7,5,3]) == 253

Answer: assert Solution().maxGoodNumber(nums = [127,127,127]) == 2097151

Answer: assert Solution().maxGoodNumber(nums = [32,16,8]) == 17440

Answer: assert Solution().maxGoodNumber(nums = [1,5,7]) == 125

Answer: assert Solution().maxGoodNumber(nums = [64,32,16]) == 135232

Answer: assert Solution().maxGoodNumber(nums = [1,2,3]) == 30

Answer: assert Solution().maxGoodNumber(nums = [2,8,16]) == 1296

Answer: assert Solution().maxGoodNumber(nums = [1,1,1]) == 7

Answer: assert Solution().maxGoodNumber(nums = [127,64,32]) == 1044544

Answer: assert Solution().maxGoodNumber(nums = [3,4,126]) == 4084

Answer: assert Solution().maxGoodNumber(nums = [127,1,1]) == 511

Answer: assert Solution().maxGoodNumber(nums = [15, 31, 63]) == 32767

Answer: assert Solution().maxGoodNumber(nums = [64, 32, 16]) == 135232

Answer: assert Solution().maxGoodNumber(nums = [99, 66, 33]) == 815298

Answer: assert Solution().maxGoodNumber(nums = [63, 1, 127]) == 16383

Answer: assert Solution().maxGoodNumber(nums = [8, 4, 2]) == 328

Answer: assert Solution().maxGoodNumber(nums = [110, 111, 112]) == 1849326

Answer: assert Solution().maxGoodNumber(nums = [5, 10, 15]) == 2010

Answer: assert Solution().maxGoodNumber(nums = [63, 31, 15]) == 32767

Answer: assert Solution().maxGoodNumber(nums = [50, 60, 70]) == 497990

Answer: assert Solution().maxGoodNumber(nums = [63,15,31]) == 32767

Answer: assert Solution().maxGoodNumber(nums = [4,16,8]) == 2320

Answer: assert Solution().maxGoodNumber(nums = [55, 25, 10]) == 28570

Answer: assert Solution().maxGoodNumber(nums = [10,200,30]) == 126090

Answer: assert Solution().maxGoodNumber(nums = [127, 1, 127]) == 32767

Answer: assert Solution().maxGoodNumber(nums = [7, 7, 7]) == 511

Answer: assert Solution().maxGoodNumber(nums = [7,5,9]) == 985

Answer: assert Solution().maxGoodNumber(nums = [21, 42, 84]) == 177492

Answer: assert Solution().maxGoodNumber(nums = [64, 1, 127]) == 32704

Answer: assert Solution().maxGoodNumber(nums = [1, 2, 4]) == 52

Answer: assert Solution().maxGoodNumber(nums = [60, 61, 62]) == 257916

Answer: assert Solution().maxGoodNumber(nums = [1, 4, 8]) == 200

Answer: assert Solution().maxGoodNumber(nums = [3, 9, 27]) == 1977

Answer: assert Solution().maxGoodNumber(nums = [8, 16, 32]) == 17440

Answer: assert Solution().maxGoodNumber(nums = [100,20,30]) == 126100

Answer: assert Solution().maxGoodNumber(nums = [63, 64, 65]) == 1040576

Answer: assert Solution().maxGoodNumber(nums = [15, 31, 127]) == 65535

Answer: assert Solution().maxGoodNumber(nums = [10, 15, 20]) == 8020

Answer: assert Solution().maxGoodNumber(nums = [1, 4, 2]) == 52

Answer: assert Solution().maxGoodNumber(nums = [99,100,101]) == 1667683

Answer: assert Solution().maxGoodNumber(nums = [7, 14, 28]) == 4060

Answer: assert Solution().maxGoodNumber(nums = [6, 12, 24]) == 3480

Answer: assert Solution().maxGoodNumber(nums = [10, 20, 30]) == 15700

Answer: assert Solution().maxGoodNumber(nums = [9, 5, 7]) == 985

Answer: assert Solution().maxGoodNumber(nums = [63, 15, 7]) == 8191

Answer: assert Solution().maxGoodNumber(nums = [6,12,24]) == 3480

Answer: assert Solution().maxGoodNumber(nums = [31, 30, 29]) == 32733

Answer: assert Solution().maxGoodNumber(nums = [126, 125, 124]) == 2080508

Answer: assert Solution().maxGoodNumber(nums = [101, 56, 29]) == 244837

Answer: assert Solution().maxGoodNumber(nums = [45, 30, 60]) == 126765

Answer: assert Solution().maxGoodNumber(nums = [127, 64, 32]) == 1044544

Answer: assert Solution().maxGoodNumber(nums = [1, 127, 64]) == 32704

Answer: assert Solution().maxGoodNumber(nums = [63, 7, 2]) == 2046

Answer: assert Solution().maxGoodNumber(nums = [11, 22, 44]) == 23980

Answer: assert Solution().maxGoodNumber(nums = [111, 44, 88]) == 915032

Answer: assert Solution().maxGoodNumber(nums = [123,45,67]) == 1013443

Answer: assert Solution().maxGoodNumber(nums = [85, 17, 34]) == 175202

Answer: assert Solution().maxGoodNumber(nums = [15, 14, 13]) == 4077

Answer: assert Solution().maxGoodNumber(nums = [5, 10, 20]) == 2900

Answer: assert Solution().maxGoodNumber(nums = [100, 50, 75]) == 832075

Answer: assert Solution().maxGoodNumber(nums = [5, 7, 9]) == 985

Answer: assert Solution().maxGoodNumber(nums = [45, 44, 43]) == 187179

Answer: assert Solution().maxGoodNumber(nums = [3, 6, 9]) == 489

Answer: assert Solution().maxGoodNumber(nums = [3,6,9]) == 489

Answer: assert Solution().maxGoodNumber(nums = [12, 15, 9]) == 4041

Answer: assert Solution().maxGoodNumber(nums = [63, 32, 16]) == 130080

Answer: assert Solution().maxGoodNumber(nums = [120, 96, 64]) == 1978432

Answer: assert Solution().maxGoodNumber(nums = [100, 50, 25]) == 211300

Answer: assert Solution().maxGoodNumber(nums = [63, 126, 96]) == 1048416

Answer: assert Solution().maxGoodNumber(nums = [1, 1, 1]) == 7

Answer: assert Solution().maxGoodNumber(nums = [126, 63, 31]) == 262142

Answer: assert Solution().maxGoodNumber(nums = [31, 3, 15]) == 2047

Answer: assert Solution().maxGoodNumber(nums = [120, 121, 122]) == 2014456

Answer: assert Solution().maxGoodNumber(nums = [99, 65, 32]) == 815200

Answer: assert Solution().maxGoodNumber(nums = [99, 88, 77]) == 1633357

Answer: assert Solution().maxGoodNumber(nums = [120, 124, 126]) == 2080376

Answer: assert Solution().maxGoodNumber(nums = [100, 99, 101]) == 1667683

Answer: assert Solution().maxGoodNumber(nums = [127, 1, 2]) == 1022

Answer: assert Solution().maxGoodNumber(nums = [7, 5, 9]) == 985

Answer: assert Solution().maxGoodNumber(nums = [80, 81, 82]) == 1353936

Answer: assert Solution().maxGoodNumber(nums = [9, 18, 27]) == 14130

Answer: assert Solution().maxGoodNumber(nums = [1,127,64]) == 32704

Answer: assert Solution().maxGoodNumber(nums = [10, 15, 3]) == 1018

Answer: assert Solution().maxGoodNumber(nums = [31, 15, 7]) == 4095

Answer: assert Solution().maxGoodNumber(nums = [30, 20, 10]) == 15700

Answer: assert Solution().maxGoodNumber(nums = [5, 9, 3]) == 473

Answer: assert Solution().maxGoodNumber(nums = [23, 45, 67]) == 194243

Answer: assert Solution().maxGoodNumber(nums = [73, 28, 14]) == 61001

Answer: assert Solution().maxGoodNumber(nums = [77, 22, 88]) == 371789

Answer: assert Solution().maxGoodNumber(nums = [60, 30, 15]) == 32700

import random
import functools
import collections
import string
import math
import datetime

from typing import *
from functools import *
from collections import *
from itertools import *
from heapq import *
from bisect import *
from string import *
from operator import *
from math import *

inf = float('inf')

class ListNode:
    def __init__(self, val=0, next=None):
        self.val = val
        self.next = next

def list_node(values: list):
    if not values:
        return None
    head = ListNode(values[0])
    p = head
    for val in values[1:]:
        node = ListNode(val)
        p.next = node
        p = node
    return head

def is_same_list(p1, p2):
    if p1 is None and p2 is None:
        return True
    if not p1 or not p2:
        return False
    return p1.val == p2.val and is_same_list(p1.next, p2.next)

class TreeNode:
    def __init__(self, val=0, left=None, right=None):
        self.val = val
        self.left = left
        self.right = right

def tree_node(values: list):
    if not values:
        return None
    root = TreeNode(values[0])
    i = 1
    queue = deque()
    queue.append(root)
    while queue:
        node = queue.popleft()
        if i < len(values) and values[i] is not None:
            node.left = TreeNode(values[i])
            queue.append(node.left)
        i += 1
        if i < len(values) and values[i] is not None:
            node.right = TreeNode(values[i])
            queue.append(node.right)
        i += 1
    return root

def is_same_tree(p, q):
    if not p and not q:
        return True
    elif not p or not q:
        return False
    elif p.val != q.val:
        return False
    else:
        return is_same_tree(p.left, q.left) and is_same_tree(p.right, q.right)

class Solution:
    def maxGoodNumber(self, nums: List[int]) -> int:
        ans = 0
        for arr in permutations(nums):
            num = int("".join(bin(i)[2:] for i in arr), 2)
            ans = max(ans, num)
        return ans