count-beautiful-substrings-i

Count Beautiful Substrings I

Prompt:
"""
You are given a string s and a positive integer k.
Let vowels and consonants be the number of vowels and consonants in a string.
A string is beautiful if:

vowels == consonants.
(vowels * consonants) % k == 0, in other terms the multiplication of vowels and consonants is divisible by k.

Return the number of non-empty beautiful substrings in the given string s.
A substring is a contiguous sequence of characters in a string.
Vowel letters in English are 'a', 'e', 'i', 'o', and 'u'.
Consonant letters in English are every letter except vowels.

Example 1:

Input: s = "baeyh", k = 2
Output: 2
Explanation: There are 2 beautiful substrings in the given string.
- Substring "baeyh", vowels = 2 (["a",e"]), consonants = 2 (["y","h"]).
You can see that string "aeyh" is beautiful as vowels == consonants and vowels * consonants % k == 0.
- Substring "baeyh", vowels = 2 (["a",e"]), consonants = 2 (["b","y"]).
You can see that string "baey" is beautiful as vowels == consonants and vowels * consonants % k == 0.
It can be shown that there are only 2 beautiful substrings in the given string.

Example 2:

Input: s = "abba", k = 1
Output: 3
Explanation: There are 3 beautiful substrings in the given string.
- Substring "abba", vowels = 1 (["a"]), consonants = 1 (["b"]).
- Substring "abba", vowels = 1 (["a"]), consonants = 1 (["b"]).
- Substring "abba", vowels = 2 (["a","a"]), consonants = 2 (["b","b"]).
It can be shown that there are only 3 beautiful substrings in the given string.

Example 3:

Input: s = "bcdf", k = 1
Output: 0
Explanation: There are no beautiful substrings in the given string.

Constraints:

1 <= s.length <= 1000
1 <= k <= 1000
s consists of only English lowercase letters.
"""
class Solution:
    def beautifulSubstrings(self, s: str, k: int) -> int:

You are given a string s and a positive integer k.
Let vowels and consonants be the number of vowels and consonants in a string.
A string is beautiful if:

vowels == consonants.
(vowels * consonants) % k == 0, in other terms the multiplication of vowels and consonants is divisible by k.

Return the number of non-empty beautiful substrings in the given string s.
A substring is a contiguous sequence of characters in a string.
Vowel letters in English are 'a', 'e', 'i', 'o', and 'u'.
Consonant letters in English are every letter except vowels.

Example 1:

Input: s = "baeyh", k = 2
Output: 2
Explanation: There are 2 beautiful substrings in the given string.
- Substring "baeyh", vowels = 2 (["a",e"]), consonants = 2 (["y","h"]).
You can see that string "aeyh" is beautiful as vowels == consonants and vowels * consonants % k == 0.
- Substring "baeyh", vowels = 2 (["a",e"]), consonants = 2 (["b","y"]).
You can see that string "baey" is beautiful as vowels == consonants and vowels * consonants % k == 0.
It can be shown that there are only 2 beautiful substrings in the given string.

Example 2:

Input: s = "abba", k = 1
Output: 3
Explanation: There are 3 beautiful substrings in the given string.
- Substring "abba", vowels = 1 (["a"]), consonants = 1 (["b"]).
- Substring "abba", vowels = 1 (["a"]), consonants = 1 (["b"]).
- Substring "abba", vowels = 2 (["a","a"]), consonants = 2 (["b","b"]).
It can be shown that there are only 3 beautiful substrings in the given string.

Example 3:

Input: s = "bcdf", k = 1
Output: 0
Explanation: There are no beautiful substrings in the given string.

Constraints:

1 <= s.length <= 1000
1 <= k <= 1000
s consists of only English lowercase letters.

Please complete the code below to solve above prblem:
```python
class Solution:
    def beautifulSubstrings(self, s: str, k: int) -> int:

```

my_solution = Solution()

test_input = { "s": "baeyh", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 2

test_input = { "s": "abba", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "bcdf", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "ihroyeeb", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "uzuxpzou", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "ouuoeqd", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "eeebjoxxujuaeoqibd", "k": 8 }
assert my_solution.beautifulSubstrings(**test_input) == 4

test_input = { "s": "ilougekqlovegioemdvu", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 21

test_input = { "s": "tqaewreikaztwpfwnef", "k": 8 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "oykiuhsafgfjumnzb", "k": 7 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "ifvsa", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "svzauyuevujektj", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "urahjig", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 2

test_input = { "s": "ime", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "oacghieut", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "aoluu", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "ioaoiciiuoziout", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 5

test_input = { "s": "ouafupsuhid", "k": 6 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "ox", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "tlaiwoauazutusiaaui", "k": 10 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "caepeym", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 2

test_input = { "s": "apyxvceue", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "imkqbb", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "caaz", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "pyicoy", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 6

test_input = { "s": "uopmyrsntjhiroikup", "k": 8 }
assert my_solution.beautifulSubstrings(**test_input) == 2

test_input = { "s": "aujfxqxcj", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "eeizejuoxeumz", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 6

test_input = { "s": "uuouuaifnboeiulttio", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 10

test_input = { "s": "woozzxd", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "pulorolqcvhafexui", "k": 9 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "hmuaewojioizoguvoaje", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 4

test_input = { "s": "b", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "aiejouohnqnketinvat", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 6

test_input = { "s": "mjiogpri", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "movbyaeouil", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 2

test_input = { "s": "puureouausxmitvav", "k": 6 }
assert my_solution.beautifulSubstrings(**test_input) == 2

test_input = { "s": "op", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "iuhoezpooxcohtlapolo", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 39

test_input = { "s": "cioi", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "pueutaoyaxk", "k": 6 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "iiuresacruaaan", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "agntyaazvpejidwaph", "k": 8 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "wiybolyniexiibou", "k": 6 }
assert my_solution.beautifulSubstrings(**test_input) == 2

test_input = { "s": "coiyakadxi", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 8

test_input = { "s": "oraajoeruiakixj", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "jeayap", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 7

test_input = { "s": "iu", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "awozoy", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "fheabmlsyeeeuoeogyz", "k": 9 }
assert my_solution.beautifulSubstrings(**test_input) == 5

test_input = { "s": "eaizneuxi", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 10

test_input = { "s": "uurqufaucsuoqljh", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 14

test_input = { "s": "jrtept", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "olgioxooiejooosaed", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "uizoy", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "lswabfiujjhexzos", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 5

test_input = { "s": "iuu", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "qeaxut", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 7

test_input = { "s": "aojiau", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "oaiaaaargkonlcsoaygf", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 2

test_input = { "s": "zoowrawkm", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "uqiwuoevkfhkkua", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 6

test_input = { "s": "kavuaaeodvaxicm", "k": 6 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "qpxeceq", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 6

test_input = { "s": "iaabaofuodcbek", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "eel", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "ikeuhe", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 5

test_input = { "s": "lueikvo", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 2

test_input = { "s": "oauau", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "qzoieeotieeakqraeao", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 4

test_input = { "s": "ehaascocsdmgekni", "k": 9 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "euqeklniykiji", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "vaeiiioidiioxhduu", "k": 7 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "aa", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "chaua", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "edfrglfr", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "dqbe", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "ghooirorxge", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 6

test_input = { "s": "fodartekaonq", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 9

test_input = { "s": "feeanzkjpfehzeuni", "k": 6 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "ignoouesduu", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 6

test_input = { "s": "yif", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "gondfjaeeuhbuuasgip", "k": 10 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "djooomsffoonelyeode", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 14

test_input = { "s": "pgaimei", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 2

test_input = { "s": "naipqentonee", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 8

test_input = { "s": "bouov", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "lcuhoypz", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "g", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "qc", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "mhznea", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "uxvjixdujgyfauo", "k": 8 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "iyjkuox", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "xbjfoayfpafatnuyord", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "nvoede", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "usnuaxpaktrweatruu", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "euojmsora", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 10

test_input = { "s": "iapgoi", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "uafuimcpxyeoixgbyeio", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "weuaatpu", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 0


make-lexicographically-smallest-array-by-swapping-elements

Make Lexicographically Smallest Array by Swapping Elements

Prompt:
"""
You are given a 0-indexed array of positive integers nums and a positive integer limit.
In one operation, you can choose any two indices i and j and swap nums[i] and nums[j] if |nums[i] - nums[j]| <= limit.
Return the lexicographically smallest array that can be obtained by performing the operation any number of times.
An array a is lexicographically smaller than an array b if in the first position where a and b differ, array a has an element that is less than the corresponding element in b. For example, the array [2,10,3] is lexicographically smaller than the array [10,2,3] because they differ at index 0 and 2 < 10.

Example 1:

Input: nums = [1,5,3,9,8], limit = 2
Output: [1,3,5,8,9]
Explanation: Apply the operation 2 times:
- Swap nums[1] with nums[2]. The array becomes [1,3,5,9,8]
- Swap nums[3] with nums[4]. The array becomes [1,3,5,8,9]
We cannot obtain a lexicographically smaller array by applying any more operations.
Note that it may be possible to get the same result by doing different operations.

Example 2:

Input: nums = [1,7,6,18,2,1], limit = 3
Output: [1,6,7,18,1,2]
Explanation: Apply the operation 3 times:
- Swap nums[1] with nums[2]. The array becomes [1,6,7,18,2,1]
- Swap nums[0] with nums[4]. The array becomes [2,6,7,18,1,1]
- Swap nums[0] with nums[5]. The array becomes [1,6,7,18,1,2]
We cannot obtain a lexicographically smaller array by applying any more operations.

Example 3:

Input: nums = [1,7,28,19,10], limit = 3
Output: [1,7,28,19,10]
Explanation: [1,7,28,19,10] is the lexicographically smallest array we can obtain because we cannot apply the operation on any two indices.

Constraints:

1 <= nums.length <= 105
1 <= nums[i] <= 109
1 <= limit <= 109
"""
class Solution:
    def lexicographicallySmallestArray(self, nums: List[int], limit: int) -> List[int]:

You are given a 0-indexed array of positive integers nums and a positive integer limit.
In one operation, you can choose any two indices i and j and swap nums[i] and nums[j] if |nums[i] - nums[j]| <= limit.
Return the lexicographically smallest array that can be obtained by performing the operation any number of times.
An array a is lexicographically smaller than an array b if in the first position where a and b differ, array a has an element that is less than the corresponding element in b. For example, the array [2,10,3] is lexicographically smaller than the array [10,2,3] because they differ at index 0 and 2 < 10.

Example 1:

Input: nums = [1,5,3,9,8], limit = 2
Output: [1,3,5,8,9]
Explanation: Apply the operation 2 times:
- Swap nums[1] with nums[2]. The array becomes [1,3,5,9,8]
- Swap nums[3] with nums[4]. The array becomes [1,3,5,8,9]
We cannot obtain a lexicographically smaller array by applying any more operations.
Note that it may be possible to get the same result by doing different operations.

Example 2:

Input: nums = [1,7,6,18,2,1], limit = 3
Output: [1,6,7,18,1,2]
Explanation: Apply the operation 3 times:
- Swap nums[1] with nums[2]. The array becomes [1,6,7,18,2,1]
- Swap nums[0] with nums[4]. The array becomes [2,6,7,18,1,1]
- Swap nums[0] with nums[5]. The array becomes [1,6,7,18,1,2]
We cannot obtain a lexicographically smaller array by applying any more operations.

Example 3:

Input: nums = [1,7,28,19,10], limit = 3
Output: [1,7,28,19,10]
Explanation: [1,7,28,19,10] is the lexicographically smallest array we can obtain because we cannot apply the operation on any two indices.

Constraints:

1 <= nums.length <= 105
1 <= nums[i] <= 109
1 <= limit <= 109

Please complete the code below to solve above prblem:
```python
class Solution:
    def lexicographicallySmallestArray(self, nums: List[int], limit: int) -> List[int]:

```

my_solution = Solution()

test_input = { "nums": [1,5,3,9,8], "limit": 2 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [1,3,5,8,9]

test_input = { "nums": [1,7,6,18,2,1], "limit": 3 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [1,6,7,18,1,2]

test_input = { "nums": [1,7,28,19,10], "limit": 3 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [1,7,28,19,10]

test_input = { "nums": [1000000000], "limit": 1 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [1000000000]

test_input = { "nums": [1,60,34,84,62,56,39,76,49,38], "limit": 4 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [1,56,34,84,60,62,38,76,49,39]

test_input = { "nums": [1,81,10,79,36,2,87,12,20,77], "limit": 7 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [1,77,10,79,36,2,81,12,20,87]

test_input = { "nums": [2,71,5,87,11,15,70,70,14,38], "limit": 14 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [2,70,5,87,11,14,70,71,15,38]

test_input = { "nums": [4,3,23,84,34,88,44,44,18,15], "limit": 3 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [3,4,23,84,34,88,44,44,15,18]

test_input = { "nums": [4,34,29,73,51,11,8,53,98,47], "limit": 10 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [4,29,34,73,47,8,11,51,98,53]

test_input = { "nums": [4,52,38,59,71,27,31,83,88,10], "limit": 14 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [4,27,31,38,52,59,71,83,88,10]

test_input = { "nums": [4,68,8,10,70,62,27,5,42,61], "limit": 11 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [4,61,5,8,62,68,27,10,42,70]

test_input = { "nums": [5,9,35,60,73,91,61,57,87,76], "limit": 11 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [5,9,35,57,73,76,60,61,87,91]

test_input = { "nums": [5,15,68,47,49,67,9,6,35,14], "limit": 4 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [5,14,67,47,49,68,6,9,35,15]

test_input = { "nums": [5,16,43,15,66,21,58,74,55,66], "limit": 9 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [5,15,43,16,55,21,58,66,66,74]

test_input = { "nums": [5,30,92,4,31,2,17,39,15,7], "limit": 3 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [2,30,92,4,31,5,15,39,17,7]

test_input = { "nums": [5,38,68,80,64,79,50,5,8,95], "limit": 7 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [5,38,64,79,68,80,50,5,8,95]

test_input = { "nums": [5,100,44,45,16,30,14,65,83,64], "limit": 15 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [5,100,14,16,30,44,45,64,83,65]

test_input = { "nums": [6,57,100,67,4,63,47,59,21,66], "limit": 8 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [4,57,100,59,6,63,47,66,21,67]

test_input = { "nums": [6,70,90,1,33,81,60,80,68,44], "limit": 7 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [1,68,90,6,33,80,60,81,70,44]

test_input = { "nums": [6,74,74,74,30,70,91,74,76,41], "limit": 1 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [6,74,74,74,30,70,91,74,76,41]

test_input = { "nums": [6,77,68,15,3,98,56,22,81,72], "limit": 2 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [6,77,68,15,3,98,56,22,81,72]

test_input = { "nums": [7,17,79,29,29,83,21,12,5,1], "limit": 10 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [1,5,79,7,12,83,17,21,29,29]

test_input = { "nums": [7,66,85,9,29,1,25,69,57,95], "limit": 13 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [1,57,85,7,25,9,29,66,69,95]

test_input = { "nums": [7,73,1,97,13,55,74,29,76,19], "limit": 14 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [1,73,7,97,13,55,74,19,76,29]

test_input = { "nums": [8,4,47,23,73,79,63,62,35,51], "limit": 11 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [4,8,47,23,51,62,63,73,35,79]

test_input = { "nums": [8,17,20,100,59,98,64,78,64,53], "limit": 1 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [8,17,20,100,59,98,64,78,64,53]

test_input = { "nums": [8,70,99,5,49,27,79,2,57,49], "limit": 14 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [2,49,99,5,49,27,57,8,70,79]

test_input = { "nums": [9,67,94,37,5,90,43,13,27,21], "limit": 11 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [5,67,90,9,13,94,21,27,37,43]

test_input = { "nums": [10,22,17,76,6,64,51,60,65,37], "limit": 9 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [6,10,17,76,22,51,60,64,65,37]

test_input = { "nums": [10,34,63,88,76,30,70,80,52,13], "limit": 7 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [10,30,63,88,70,34,76,80,52,13]

test_input = { "nums": [10,69,4,28,15,30,23,53,41,93], "limit": 9 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [4,69,10,15,23,28,30,53,41,93]

test_input = { "nums": [12,86,98,73,64,77,30,76,46,69], "limit": 4 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [12,86,98,69,64,73,30,76,46,77]

test_input = { "nums": [13,43,32,15,45,69,58,89,64,76], "limit": 12 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [13,32,43,15,45,58,64,89,69,76]

test_input = { "nums": [13,70,11,74,73,21,4,45,95,38], "limit": 9 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [4,70,11,73,74,13,21,38,95,45]

test_input = { "nums": [14,15,53,11,38,18,27,69,55,2], "limit": 13 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [2,11,53,14,15,18,27,69,55,38]

test_input = { "nums": [14,28,61,49,10,25,80,83,42,100], "limit": 3 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [14,25,61,49,10,28,80,83,42,100]

test_input = { "nums": [14,71,7,77,99,90,20,81,100,65], "limit": 7 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [7,65,14,71,99,90,20,77,100,81]

test_input = { "nums": [14,95,75,100,33,98,88,2,74,26], "limit": 1 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [14,95,74,100,33,98,88,2,75,26]

test_input = { "nums": [15,29,16,37,10,70,58,5,33,76], "limit": 8 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [5,29,10,33,15,70,58,16,37,76]

test_input = { "nums": [15,33,1,74,47,6,60,95,78,72], "limit": 7 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [15,33,1,72,47,6,60,95,74,78]

test_input = { "nums": [16,20,79,92,17,7,70,41,54,18], "limit": 6 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [16,17,79,92,18,7,70,41,54,20]

test_input = { "nums": [16,43,19,36,99,15,70,89,45,71], "limit": 4 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [15,43,16,36,99,19,70,89,45,71]

test_input = { "nums": [17,99,88,73,13,1,3,5,55,4], "limit": 15 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [1,73,88,99,3,4,5,13,55,17]

test_input = { "nums": [18,97,57,1,23,36,77,80,47,91], "limit": 10 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [18,91,47,1,23,36,77,80,57,97]

test_input = { "nums": [19,25,49,96,35,69,81,81,51,50], "limit": 12 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [19,25,49,96,35,69,81,81,50,51]

test_input = { "nums": [19,37,12,11,70,99,88,36,64,9], "limit": 3 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [19,36,9,11,70,99,88,37,64,12]

test_input = { "nums": [19,64,26,5,70,10,17,66,51,36], "limit": 13 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [5,51,10,17,64,19,26,66,70,36]

test_input = { "nums": [21,14,21,34,4,88,39,62,30,20], "limit": 12 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [4,14,20,21,21,88,30,62,34,39]

test_input = { "nums": [22,94,100,54,97,14,100,48,41,35], "limit": 6 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [22,94,97,48,100,14,100,54,35,41]

test_input = { "nums": [23,50,8,48,62,26,92,5,96,9], "limit": 13 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [23,48,5,50,62,26,92,8,96,9]

test_input = { "nums": [25,47,34,69,36,91,14,44,37,2], "limit": 1 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [25,47,34,69,36,91,14,44,37,2]

test_input = { "nums": [25,58,36,16,42,57,17,96,10,2], "limit": 13 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [2,57,10,16,17,58,25,96,36,42]

test_input = { "nums": [26,21,9,15,94,47,52,86,89,7], "limit": 9 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [7,9,15,21,86,47,52,89,94,26]

test_input = { "nums": [27,26,24,2,95,90,41,14,20,35], "limit": 2 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [24,26,27,2,95,90,41,14,20,35]

test_input = { "nums": [27,56,68,41,39,80,60,36,24,5], "limit": 13 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [24,56,60,27,36,68,80,39,41,5]

test_input = { "nums": [27,71,52,71,68,2,49,37,34,97], "limit": 8 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [27,68,49,71,71,2,52,34,37,97]

test_input = { "nums": [29,82,25,91,17,9,38,25,29,68], "limit": 7 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [25,82,25,91,17,9,38,29,29,68]

test_input = { "nums": [30,48,76,86,21,1,55,49,90,9], "limit": 2 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [30,48,76,86,21,1,55,49,90,9]

test_input = { "nums": [31,10,64,15,60,32,88,79,79,33], "limit": 2 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [31,10,64,15,60,32,88,79,79,33]

test_input = { "nums": [32,70,43,51,40,73,56,39,75,45], "limit": 8 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [32,70,39,40,43,73,45,51,75,56]

test_input = { "nums": [32,95,51,87,29,43,21,55,45,84], "limit": 2 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [32,95,51,87,29,43,21,55,45,84]

test_input = { "nums": [33,25,25,65,82,71,56,82,13,46], "limit": 14 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [13,25,25,33,46,56,65,71,82,82]

test_input = { "nums": [33,37,77,41,83,75,96,97,4,60], "limit": 15 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [33,37,60,41,75,77,83,96,4,97]

test_input = { "nums": [35,81,18,79,47,53,20,2,98,22], "limit": 2 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [35,79,18,81,47,53,20,2,98,22]

test_input = { "nums": [36,39,100,4,44,33,65,11,15,35], "limit": 10 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [33,35,100,4,36,39,65,11,15,44]

test_input = { "nums": [38,56,60,98,21,15,70,37,24,61], "limit": 15 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [15,56,60,98,21,24,61,37,38,70]

test_input = { "nums": [39,36,18,39,99,51,68,92,5,38], "limit": 4 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [36,38,18,39,99,51,68,92,5,39]

test_input = { "nums": [39,89,81,37,67,37,98,89,49,47], "limit": 12 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [37,81,89,37,67,39,89,98,47,49]

test_input = { "nums": [40,67,99,53,95,47,59,99,64,44], "limit": 7 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [40,44,95,47,99,53,59,99,64,67]

test_input = { "nums": [40,97,72,48,55,91,83,82,91,63], "limit": 11 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [40,48,55,63,72,82,83,91,91,97]

test_input = { "nums": [41,10,22,43,17,38,67,7,68,70], "limit": 7 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [38,7,10,41,17,43,67,22,68,70]

test_input = { "nums": [41,25,83,44,39,37,67,33,58,5], "limit": 1 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [41,25,83,44,39,37,67,33,58,5]

test_input = { "nums": [41,87,34,74,77,62,18,28,5,8], "limit": 1 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [41,87,34,74,77,62,18,28,5,8]

test_input = { "nums": [45,1,66,44,45,74,75,96,31,47], "limit": 2 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [44,1,66,45,45,74,75,96,31,47]

test_input = { "nums": [45,64,77,71,73,6,24,55,82,25], "limit": 3 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [45,64,77,71,73,6,24,55,82,25]

test_input = { "nums": [46,72,1,33,1,51,78,96,44,20], "limit": 1 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [46,72,1,33,1,51,78,96,44,20]

test_input = { "nums": [47,32,72,79,16,69,85,70,87,73], "limit": 2 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [47,32,69,79,16,70,85,72,87,73]

test_input = { "nums": [47,94,72,49,50,62,17,22,85,86], "limit": 7 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [47,94,72,49,50,62,17,22,85,86]

test_input = { "nums": [48,39,45,58,26,57,38,63,82,80], "limit": 2 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [48,38,45,57,26,58,39,63,80,82]

test_input = { "nums": [48,51,51,39,54,56,57,6,1,40], "limit": 2 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [48,51,51,39,54,56,57,6,1,40]

test_input = { "nums": [49,4,95,24,20,12,70,60,82,62], "limit": 11 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [49,4,95,12,20,24,60,62,82,70]

test_input = { "nums": [49,7,92,79,43,88,31,89,36,97], "limit": 8 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [31,7,88,79,36,89,43,92,49,97]

test_input = { "nums": [49,16,32,11,7,57,69,41,52,23], "limit": 15 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [7,11,16,23,32,41,49,52,57,69]

test_input = { "nums": [49,26,82,77,52,76,90,23,64,42], "limit": 12 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [42,23,49,52,64,76,77,26,82,90]

test_input = { "nums": [49,62,63,32,57,22,74,87,42,19], "limit": 13 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [19,22,32,42,49,57,62,63,74,87]

test_input = { "nums": [49,93,5,15,56,2,65,74,82,42], "limit": 13 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [42,49,2,5,56,15,65,74,82,93]

test_input = { "nums": [49,93,100,79,76,14,90,32,4,5], "limit": 10 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [49,90,93,76,79,4,100,32,5,14]

test_input = { "nums": [49,96,75,44,74,78,82,40,43,68], "limit": 4 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [49,96,74,40,75,78,82,43,44,68]

test_input = { "nums": [51,61,49,11,69,78,40,98,68,36], "limit": 10 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [36,40,49,11,51,61,68,98,69,78]

test_input = { "nums": [51,99,52,80,83,69,18,49,71,13], "limit": 14 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [49,99,51,69,71,80,13,52,83,18]

test_input = { "nums": [52,28,93,16,33,37,37,21,47,64], "limit": 12 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [16,21,93,28,33,37,37,47,52,64]

test_input = { "nums": [53,7,99,22,3,50,62,70,56,40], "limit": 2 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [53,7,99,22,3,50,62,70,56,40]

test_input = { "nums": [53,17,39,72,5,78,40,3,84,20], "limit": 5 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [53,17,39,72,3,78,40,5,84,20]

test_input = { "nums": [53,71,55,38,26,89,20,98,55,21], "limit": 4 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [53,71,55,38,26,89,20,98,55,21]

test_input = { "nums": [53,71,74,7,99,64,95,99,90,22], "limit": 9 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [53,64,71,7,90,74,95,99,99,22]

test_input = { "nums": [55,19,82,86,12,64,44,76,88,31], "limit": 4 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [55,19,82,86,12,64,44,76,88,31]

test_input = { "nums": [56,13,55,1,18,36,45,25,20,52], "limit": 14 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [1,13,18,20,25,36,45,52,55,56]

test_input = { "nums": [56,28,50,100,56,99,80,71,6,5], "limit": 7 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [50,28,56,99,56,100,80,71,5,6]

test_input = { "nums": [56,35,19,2,83,20,96,42,33,68], "limit": 3 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [56,33,19,2,83,20,96,42,35,68]

test_input = { "nums": [56,69,94,21,65,46,64,91,75,25], "limit": 5 }
assert my_solution.lexicographicallySmallestArray(**test_input) == [56,64,91,21,65,46,69,94,75,25]


count-beautiful-substrings-ii

Count Beautiful Substrings II

Prompt:
"""
You are given a string s and a positive integer k.
Let vowels and consonants be the number of vowels and consonants in a string.
A string is beautiful if:

vowels == consonants.
(vowels * consonants) % k == 0, in other terms the multiplication of vowels and consonants is divisible by k.

Return the number of non-empty beautiful substrings in the given string s.
A substring is a contiguous sequence of characters in a string.
Vowel letters in English are 'a', 'e', 'i', 'o', and 'u'.
Consonant letters in English are every letter except vowels.

Example 1:

Input: s = "baeyh", k = 2
Output: 2
Explanation: There are 2 beautiful substrings in the given string.
- Substring "baeyh", vowels = 2 (["a",e"]), consonants = 2 (["y","h"]).
You can see that string "aeyh" is beautiful as vowels == consonants and vowels * consonants % k == 0.
- Substring "baeyh", vowels = 2 (["a",e"]), consonants = 2 (["b","y"]).
You can see that string "baey" is beautiful as vowels == consonants and vowels * consonants % k == 0.
It can be shown that there are only 2 beautiful substrings in the given string.

Example 2:

Input: s = "abba", k = 1
Output: 3
Explanation: There are 3 beautiful substrings in the given string.
- Substring "abba", vowels = 1 (["a"]), consonants = 1 (["b"]).
- Substring "abba", vowels = 1 (["a"]), consonants = 1 (["b"]).
- Substring "abba", vowels = 2 (["a","a"]), consonants = 2 (["b","b"]).
It can be shown that there are only 3 beautiful substrings in the given string.

Example 3:

Input: s = "bcdf", k = 1
Output: 0
Explanation: There are no beautiful substrings in the given string.

Constraints:

1 <= s.length <= 5 * 104
1 <= k <= 1000
s consists of only English lowercase letters.
"""
class Solution:
    def beautifulSubstrings(self, s: str, k: int) -> int:

You are given a string s and a positive integer k.
Let vowels and consonants be the number of vowels and consonants in a string.
A string is beautiful if:

vowels == consonants.
(vowels * consonants) % k == 0, in other terms the multiplication of vowels and consonants is divisible by k.

Return the number of non-empty beautiful substrings in the given string s.
A substring is a contiguous sequence of characters in a string.
Vowel letters in English are 'a', 'e', 'i', 'o', and 'u'.
Consonant letters in English are every letter except vowels.

Example 1:

Input: s = "baeyh", k = 2
Output: 2
Explanation: There are 2 beautiful substrings in the given string.
- Substring "baeyh", vowels = 2 (["a",e"]), consonants = 2 (["y","h"]).
You can see that string "aeyh" is beautiful as vowels == consonants and vowels * consonants % k == 0.
- Substring "baeyh", vowels = 2 (["a",e"]), consonants = 2 (["b","y"]).
You can see that string "baey" is beautiful as vowels == consonants and vowels * consonants % k == 0.
It can be shown that there are only 2 beautiful substrings in the given string.

Example 2:

Input: s = "abba", k = 1
Output: 3
Explanation: There are 3 beautiful substrings in the given string.
- Substring "abba", vowels = 1 (["a"]), consonants = 1 (["b"]).
- Substring "abba", vowels = 1 (["a"]), consonants = 1 (["b"]).
- Substring "abba", vowels = 2 (["a","a"]), consonants = 2 (["b","b"]).
It can be shown that there are only 3 beautiful substrings in the given string.

Example 3:

Input: s = "bcdf", k = 1
Output: 0
Explanation: There are no beautiful substrings in the given string.

Constraints:

1 <= s.length <= 5 * 104
1 <= k <= 1000
s consists of only English lowercase letters.

Please complete the code below to solve above prblem:
```python
class Solution:
    def beautifulSubstrings(self, s: str, k: int) -> int:

```

my_solution = Solution()

test_input = { "s": "baeyh", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 2

test_input = { "s": "abba", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "bcdf", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "ihroyeeb", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "uzuxpzou", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "ouuoeqd", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "eeebjoxxujuaeoqibd", "k": 8 }
assert my_solution.beautifulSubstrings(**test_input) == 4

test_input = { "s": "ilougekqlovegioemdvu", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 21

test_input = { "s": "tqaewreikaztwpfwnef", "k": 8 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "oykiuhsafgfjumnzb", "k": 7 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "ifvsa", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "svzauyuevujektj", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "urahjig", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 2

test_input = { "s": "ime", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "oacghieut", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "aoluu", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "ioaoiciiuoziout", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 5

test_input = { "s": "ouafupsuhid", "k": 6 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "ox", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "tlaiwoauazutusiaaui", "k": 10 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "caepeym", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 2

test_input = { "s": "apyxvceue", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "imkqbb", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "caaz", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "pyicoy", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 6

test_input = { "s": "uopmyrsntjhiroikup", "k": 8 }
assert my_solution.beautifulSubstrings(**test_input) == 2

test_input = { "s": "aujfxqxcj", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "eeizejuoxeumz", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 6

test_input = { "s": "uuouuaifnboeiulttio", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 10

test_input = { "s": "woozzxd", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "pulorolqcvhafexui", "k": 9 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "hmuaewojioizoguvoaje", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 4

test_input = { "s": "b", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "aiejouohnqnketinvat", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 6

test_input = { "s": "mjiogpri", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "movbyaeouil", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 2

test_input = { "s": "puureouausxmitvav", "k": 6 }
assert my_solution.beautifulSubstrings(**test_input) == 2

test_input = { "s": "op", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "iuhoezpooxcohtlapolo", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 39

test_input = { "s": "cioi", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "pueutaoyaxk", "k": 6 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "iiuresacruaaan", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "agntyaazvpejidwaph", "k": 8 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "wiybolyniexiibou", "k": 6 }
assert my_solution.beautifulSubstrings(**test_input) == 2

test_input = { "s": "coiyakadxi", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 8

test_input = { "s": "oraajoeruiakixj", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "jeayap", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 7

test_input = { "s": "iu", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "awozoy", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "fheabmlsyeeeuoeogyz", "k": 9 }
assert my_solution.beautifulSubstrings(**test_input) == 5

test_input = { "s": "eaizneuxi", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 10

test_input = { "s": "uurqufaucsuoqljh", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 14

test_input = { "s": "jrtept", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "olgioxooiejooosaed", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "uizoy", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "lswabfiujjhexzos", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 5

test_input = { "s": "iuu", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "qeaxut", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 7

test_input = { "s": "aojiau", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "oaiaaaargkonlcsoaygf", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 2

test_input = { "s": "zoowrawkm", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "uqiwuoevkfhkkua", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 6

test_input = { "s": "kavuaaeodvaxicm", "k": 6 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "qpxeceq", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 6

test_input = { "s": "iaabaofuodcbek", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "eel", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "ikeuhe", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 5

test_input = { "s": "lueikvo", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 2

test_input = { "s": "oauau", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "qzoieeotieeakqraeao", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 4

test_input = { "s": "ehaascocsdmgekni", "k": 9 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "euqeklniykiji", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "vaeiiioidiioxhduu", "k": 7 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "aa", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "chaua", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "edfrglfr", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "dqbe", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "ghooirorxge", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 6

test_input = { "s": "fodartekaonq", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 9

test_input = { "s": "feeanzkjpfehzeuni", "k": 6 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "ignoouesduu", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 6

test_input = { "s": "yif", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "gondfjaeeuhbuuasgip", "k": 10 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "djooomsffoonelyeode", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 14

test_input = { "s": "pgaimei", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 2

test_input = { "s": "naipqentonee", "k": 4 }
assert my_solution.beautifulSubstrings(**test_input) == 8

test_input = { "s": "bouov", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "lcuhoypz", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "g", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "qc", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "mhznea", "k": 2 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "uxvjixdujgyfauo", "k": 8 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "iyjkuox", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "xbjfoayfpafatnuyord", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "nvoede", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 1

test_input = { "s": "usnuaxpaktrweatruu", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "euojmsora", "k": 1 }
assert my_solution.beautifulSubstrings(**test_input) == 10

test_input = { "s": "iapgoi", "k": 3 }
assert my_solution.beautifulSubstrings(**test_input) == 0

test_input = { "s": "uafuimcpxyeoixgbyeio", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 3

test_input = { "s": "weuaatpu", "k": 5 }
assert my_solution.beautifulSubstrings(**test_input) == 0


find-words-containing-character

Find Words Containing Character

Prompt:
"""
You are given a 0-indexed array of strings words and a character x.
Return an array of indices representing the words that contain the character x.
Note that the returned array may be in any order.

Example 1:

Input: words = ["leet","code"], x = "e"
Output: [0,1]
Explanation: "e" occurs in both words: "leet", and "code". Hence, we return indices 0 and 1.

Example 2:

Input: words = ["abc","bcd","aaaa","cbc"], x = "a"
Output: [0,2]
Explanation: "a" occurs in "abc", and "aaaa". Hence, we return indices 0 and 2.

Example 3:

Input: words = ["abc","bcd","aaaa","cbc"], x = "z"
Output: []
Explanation: "z" does not occur in any of the words. Hence, we return an empty array.

Constraints:

1 <= words.length <= 50
1 <= words[i].length <= 50
x is a lowercase English letter.
words[i] consists only of lowercase English letters.
"""
class Solution:
    def findWordsContaining(self, words: List[str], x: str) -> List[int]:

You are given a 0-indexed array of strings words and a character x.
Return an array of indices representing the words that contain the character x.
Note that the returned array may be in any order.

Example 1:

Input: words = ["leet","code"], x = "e"
Output: [0,1]
Explanation: "e" occurs in both words: "leet", and "code". Hence, we return indices 0 and 1.

Example 2:

Input: words = ["abc","bcd","aaaa","cbc"], x = "a"
Output: [0,2]
Explanation: "a" occurs in "abc", and "aaaa". Hence, we return indices 0 and 2.

Example 3:

Input: words = ["abc","bcd","aaaa","cbc"], x = "z"
Output: []
Explanation: "z" does not occur in any of the words. Hence, we return an empty array.

Constraints:

1 <= words.length <= 50
1 <= words[i].length <= 50
x is a lowercase English letter.
words[i] consists only of lowercase English letters.

Please complete the code below to solve above prblem:
```python
class Solution:
    def findWordsContaining(self, words: List[str], x: str) -> List[int]:

```

my_solution = Solution()

test_input = { "words": ["leet","code"], "x": "e" }
assert my_solution.findWordsContaining(**test_input) == [0,1]

test_input = { "words": ["abc","bcd","aaaa","cbc"], "x": "a" }
assert my_solution.findWordsContaining(**test_input) == [0,2]

test_input = { "words": ["abc","bcd","aaaa","cbc"], "x": "z" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["sgtkshnss","m","ryvbkyvuz","ezittyjwgb","wudlwg"], "x": "x" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["lkwnhpbj","tlohm","juazsb","f","rq"], "x": "v" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["aaa","imvtfjmxr","wbzfoovjnf","hqwrwmi"], "x": "c" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["utyeachht","bgpkcs","skeecqvvvw","nccrd"], "x": "i" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["alcpxexztg","r"], "x": "h" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["ekcpg","pdknua","fot","janppw","ofomkfvx"], "x": "g" }
assert my_solution.findWordsContaining(**test_input) == [0]

test_input = { "words": ["dq","rlvopu"], "x": "d" }
assert my_solution.findWordsContaining(**test_input) == [0]

test_input = { "words": ["wzppkd","jxvk","zaztizmwuv","hvcdtobr"], "x": "b" }
assert my_solution.findWordsContaining(**test_input) == [3]

test_input = { "words": ["y","hs","qznrkpi"], "x": "v" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["pze","yojczsb","mjvyr","i","xsygks"], "x": "q" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["qsgtjagcu","m"], "x": "e" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["kidtwmw","ogh","trdedlh","wwbtlindg","naoylytpof","ujcbzwzkm","doamcoxdv"], "x": "o" }
assert my_solution.findWordsContaining(**test_input) == [1,4,6]

test_input = { "words": ["tsmeupctki"], "x": "t" }
assert my_solution.findWordsContaining(**test_input) == [0]

test_input = { "words": ["dqxlbljmpf","uvdzfoiqg","jsnbnx","fbedae","nodewb","o","ivepktj"], "x": "g" }
assert my_solution.findWordsContaining(**test_input) == [1]

test_input = { "words": ["fjlmmecm","sautsoorhl","n","hsyco","amlukrpjpv","rmhdnj","g"], "x": "e" }
assert my_solution.findWordsContaining(**test_input) == [0]

test_input = { "words": ["khjchmeciv","vgx","xghr","bbufgegu","qyfxu"], "x": "r" }
assert my_solution.findWordsContaining(**test_input) == [2]

test_input = { "words": ["jhtcugtcpl","bvhlgmmla","ntfkwzite","imbtzafaj","sdl","t"], "x": "m" }
assert my_solution.findWordsContaining(**test_input) == [1,3]

test_input = { "words": ["kxoziqoafc","vifcxifq"], "x": "q" }
assert my_solution.findWordsContaining(**test_input) == [0,1]

test_input = { "words": ["ckfkjjsonl","scaaug","rmvqzyiwc","a","smymw"], "x": "p" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["t","exo","npr","skd","bxpmbu"], "x": "e" }
assert my_solution.findWordsContaining(**test_input) == [1]

test_input = { "words": ["eulsl","fwooyct","ypytexil"], "x": "c" }
assert my_solution.findWordsContaining(**test_input) == [1]

test_input = { "words": ["nhd","zheyegi","ogz","fpybmcc","ntbbwtde"], "x": "g" }
assert my_solution.findWordsContaining(**test_input) == [1,2]

test_input = { "words": ["gwzvusl","upcpvbfyxy","hg","yu","wsfqgzhh","zgphqacsyo"], "x": "o" }
assert my_solution.findWordsContaining(**test_input) == [5]

test_input = { "words": ["uiovpph","xxj","uwzxzvkobk"], "x": "r" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["abtrpwo","sgaegnavk","pfmv"], "x": "z" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["m","fxtphsdmgy","otq","vwuhhnebr","yen"], "x": "y" }
assert my_solution.findWordsContaining(**test_input) == [1,4]

test_input = { "words": ["irlzx","lbrknhl","roupfj","fskaieszo","nz","ijfyejq"], "x": "e" }
assert my_solution.findWordsContaining(**test_input) == [3,5]

test_input = { "words": ["raavc","tx"], "x": "l" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["bkpuvcrexw","hxtbcdprhr","ovt","xgurm","pjcz","sbhwpjmyz"], "x": "g" }
assert my_solution.findWordsContaining(**test_input) == [3]

test_input = { "words": ["f","xlmy","akbiqa","fobo"], "x": "s" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["mhan"], "x": "a" }
assert my_solution.findWordsContaining(**test_input) == [0]

test_input = { "words": ["uisx"], "x": "o" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["znqdolksyn","keewspe","ffod","lah","gadhym","awnyymd","fvkl"], "x": "v" }
assert my_solution.findWordsContaining(**test_input) == [6]

test_input = { "words": ["ftujx","dnbwrurk","t","x","zjzhdl","jc"], "x": "t" }
assert my_solution.findWordsContaining(**test_input) == [0,2]

test_input = { "words": ["zrwf","thp","qecwlnq","w","teetdaxx"], "x": "t" }
assert my_solution.findWordsContaining(**test_input) == [1,4]

test_input = { "words": ["xyzgb","qflfrfqgaf"], "x": "l" }
assert my_solution.findWordsContaining(**test_input) == [1]

test_input = { "words": ["shnjr","qfvop"], "x": "y" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["fmwclqh","xbphhgreze","yi","gmtzrfdab","uicqa","n"], "x": "i" }
assert my_solution.findWordsContaining(**test_input) == [2,4]

test_input = { "words": ["jgkv","njhwihtv","v"], "x": "z" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["tqkwoofh","bcgngl","frjpqgrr","drvb"], "x": "x" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["npkvocbw","tn","dp","c","g","fsxvzcnty","ywnf"], "x": "k" }
assert my_solution.findWordsContaining(**test_input) == [0]

test_input = { "words": ["leompil","vta","fzrsps","yp","bykmgwgk"], "x": "o" }
assert my_solution.findWordsContaining(**test_input) == [0]

test_input = { "words": ["umq","c","ctuh","eadzeuui","tabum","isuct"], "x": "p" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["rnmpdkmrnb","icxxsvss","h","gd"], "x": "s" }
assert my_solution.findWordsContaining(**test_input) == [1]

test_input = { "words": ["ft","hsjf","e","xi"], "x": "w" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["ozf","xkehlkgp","vliewlbv","okgaahah"], "x": "b" }
assert my_solution.findWordsContaining(**test_input) == [2]

test_input = { "words": ["gbktzr","kbamubluz","dwoi","crhldx","idjronpded","rqaz"], "x": "c" }
assert my_solution.findWordsContaining(**test_input) == [3]

test_input = { "words": ["gvbzqcb","rwtbra","iuijl","qbmpbi"], "x": "c" }
assert my_solution.findWordsContaining(**test_input) == [0]

test_input = { "words": ["lsh","szhxhcdc","quem","zupiydjeqp","czxyvysrrb","aqnlqtnfiv"], "x": "p" }
assert my_solution.findWordsContaining(**test_input) == [3]

test_input = { "words": ["leuah","liaoczeuch","ol","ify","layh","ifzudwuybw","x"], "x": "p" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["ksdpwwho","ktunsikyu"], "x": "a" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["vpypaumzlp","kqrb","pgw"], "x": "l" }
assert my_solution.findWordsContaining(**test_input) == [0]

test_input = { "words": ["jkrpnx","c","kqi","xrsaviyusg","waoxq","fld","otxfgcp"], "x": "l" }
assert my_solution.findWordsContaining(**test_input) == [5]

test_input = { "words": ["tetw","zl","wd","hnkxoxlnz","dexgufawjd","oolpr","yyfwizbsl"], "x": "p" }
assert my_solution.findWordsContaining(**test_input) == [5]

test_input = { "words": ["hihprd","kitgiflc","nr","idduuahfkm"], "x": "x" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["flfxeca","g"], "x": "e" }
assert my_solution.findWordsContaining(**test_input) == [0]

test_input = { "words": ["st","betf","ipacxza","jpnw"], "x": "r" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["cvuxnzaib","c","tiytr","yiav","hp","yg"], "x": "d" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["yz","k","midujexvn","kwcgbht"], "x": "y" }
assert my_solution.findWordsContaining(**test_input) == [0]

test_input = { "words": ["qcxobdaxv"], "x": "q" }
assert my_solution.findWordsContaining(**test_input) == [0]

test_input = { "words": ["b","shrexcf","ve","eqpbnuy","qdhahodo","aerdf","bdjlaakagk"], "x": "p" }
assert my_solution.findWordsContaining(**test_input) == [3]

test_input = { "words": ["ympv"], "x": "q" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["thfy","lnfzoyafiy","qmc","boijcl","pvbzmsa","yjarwylcyc"], "x": "e" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["hqptwi"], "x": "o" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["bv","xgrhtjnxh","fdtljkxa","po","hejof"], "x": "k" }
assert my_solution.findWordsContaining(**test_input) == [2]

test_input = { "words": ["mfdrclyx","pith"], "x": "e" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["bxeblhrl","o","uvv"], "x": "b" }
assert my_solution.findWordsContaining(**test_input) == [0]

test_input = { "words": ["giygz"], "x": "u" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["ffqw","nykncbxrqi","pgzy","of","oye","f"], "x": "g" }
assert my_solution.findWordsContaining(**test_input) == [2]

test_input = { "words": ["jjnh","nrbh","z"], "x": "l" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["gdzkdtvrm","ps","kp","sbdlkac","s","bt"], "x": "n" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["hpsk","stjltzz","gvbjwzktgg","hmeovbxvv","gqaxqoshbh","mqnwyabqq","sq"], "x": "f" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["gwmg","qdjeaxgc","rlajltxpd","d"], "x": "g" }
assert my_solution.findWordsContaining(**test_input) == [0,1]

test_input = { "words": ["dupx","r","j","wq","macfcfoz"], "x": "r" }
assert my_solution.findWordsContaining(**test_input) == [1]

test_input = { "words": ["rmypzoyto","wvhtrbuz","dgt","tmhqswmkx","trpjwzitp","tbetdxic"], "x": "t" }
assert my_solution.findWordsContaining(**test_input) == [0,1,2,3,4,5]

test_input = { "words": ["vpkjymgdb","s","gv","geie"], "x": "g" }
assert my_solution.findWordsContaining(**test_input) == [0,2,3]

test_input = { "words": ["epnmbry","hhfhprvqba"], "x": "l" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["zst","mjzbdxsks","dza","neqj","oqeilr"], "x": "d" }
assert my_solution.findWordsContaining(**test_input) == [1,2]

test_input = { "words": ["ffruqk","sse","cyj","tntq","mibbhhpce"], "x": "c" }
assert my_solution.findWordsContaining(**test_input) == [2,4]

test_input = { "words": ["vumzrbe","qudq","qfrt"], "x": "u" }
assert my_solution.findWordsContaining(**test_input) == [0,1]

test_input = { "words": ["wcrrprvu","fizkw","vzcjxhjy","e"], "x": "r" }
assert my_solution.findWordsContaining(**test_input) == [0]

test_input = { "words": ["gjk","vri"], "x": "n" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["fds","vbmg","p","iesyvc","wgmyxhoo","yfllvzr"], "x": "f" }
assert my_solution.findWordsContaining(**test_input) == [0,5]

test_input = { "words": ["mifbjo","kpjlwfbas","skhueysodn","zeewicisy"], "x": "g" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["pvkmoccv","j"], "x": "y" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["s","uhcfwsssbe","iwofeukmx","yfta","ovrdcb","psnje"], "x": "s" }
assert my_solution.findWordsContaining(**test_input) == [0,1,5]

test_input = { "words": ["klpzrjw","qmrhbpa"], "x": "v" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["fzegksjmw","masiwhjue","gngsht","xwvmp","aahn","dwxr"], "x": "c" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["mveahpesx","tsqds","g","mux","bivffitjx","zfsqdje"], "x": "f" }
assert my_solution.findWordsContaining(**test_input) == [4,5]

test_input = { "words": ["c"], "x": "a" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["jzmhnhqkq"], "x": "a" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["cfdgbc","ltpvko","batjenrlq","edwefhw"], "x": "t" }
assert my_solution.findWordsContaining(**test_input) == [1,2]

test_input = { "words": ["smlcojfydr","slb"], "x": "r" }
assert my_solution.findWordsContaining(**test_input) == [0]

test_input = { "words": ["lnjimir"], "x": "x" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["do"], "x": "e" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["xyyvbxsb","dc","mmqpb","mmbwv","wdreyof","kpk","reeb"], "x": "l" }
assert my_solution.findWordsContaining(**test_input) == []

test_input = { "words": ["ytvyknnmzv","jsoe","wctzk"], "x": "i" }
assert my_solution.findWordsContaining(**test_input) == []


maximize-area-of-square-hole-in-grid

Maximize Area of Square Hole in Grid

Prompt:
"""
There is a grid with n + 2 horizontal bars and m + 2 vertical bars, and initially containing 1 x 1 unit cells.
The bars are 1-indexed.
You are given the two integers, n and m.
You are also given two integer arrays: hBars and vBars.

hBars contains distinct horizontal bars in the range [2, n + 1].
vBars contains distinct vertical bars in the range [2, m + 1].

You are allowed to remove bars that satisfy any of the following conditions:

If it is a horizontal bar, it must correspond to a value in hBars.
If it is a vertical bar, it must correspond to a value in vBars.

Return an integer denoting the maximum area of a square-shaped hole in the grid after removing some bars (possibly none).

Example 1:

Input: n = 2, m = 1, hBars = [2,3], vBars = [2]
Output: 4
Explanation: The left image shows the initial grid formed by the bars.
The horizontal bars are in the range [1,4], and the vertical bars are in the range [1,3].
It is allowed to remove horizontal bars [2,3] and the vertical bar [2].
One way to get the maximum square-shaped hole is by removing horizontal bar 2 and vertical bar 2.
The resulting grid is shown on the right.
The hole has an area of 4.
It can be shown that it is not possible to get a square hole with an area more than 4.
Hence, the answer is 4.

Example 2:

Input: n = 1, m = 1, hBars = [2], vBars = [2]
Output: 4
Explanation: The left image shows the initial grid formed by the bars.
The horizontal bars are in the range [1,3], and the vertical bars are in the range [1,3].
It is allowed to remove the horizontal bar [2] and the vertical bar [2].
To get the maximum square-shaped hole, we remove horizontal bar 2 and vertical bar 2.
The resulting grid is shown on the right.
The hole has an area of 4.
Hence, the answer is 4, and it is the maximum possible.

Example 3:

Input: n = 2, m = 3, hBars = [2,3], vBars = [2,3,4]
Output: 9
Explanation: The left image shows the initial grid formed by the bars.
The horizontal bars are in the range [1,4], and the vertical bars are in the range [1,5].
It is allowed to remove horizontal bars [2,3] and vertical bars [2,3,4].
One way to get the maximum square-shaped hole is by removing horizontal bars 2 and 3, and vertical bars 3 and 4.
The resulting grid is shown on the right.
The hole has an area of 9.
It can be shown that it is not possible to get a square hole with an area more than 9.
Hence, the answer is 9.

Constraints:

1 <= n <= 109
1 <= m <= 109
1 <= hBars.length <= 100
2 <= hBars[i] <= n + 1
1 <= vBars.length <= 100
2 <= vBars[i] <= m + 1
All values in hBars are distinct.
All values in vBars are distinct.
"""
class Solution:
    def maximizeSquareHoleArea(self, n: int, m: int, hBars: List[int], vBars: List[int]) -> int:

There is a grid with n + 2 horizontal bars and m + 2 vertical bars, and initially containing 1 x 1 unit cells.
The bars are 1-indexed.
You are given the two integers, n and m.
You are also given two integer arrays: hBars and vBars.

hBars contains distinct horizontal bars in the range [2, n + 1].
vBars contains distinct vertical bars in the range [2, m + 1].

You are allowed to remove bars that satisfy any of the following conditions:

If it is a horizontal bar, it must correspond to a value in hBars.
If it is a vertical bar, it must correspond to a value in vBars.

Return an integer denoting the maximum area of a square-shaped hole in the grid after removing some bars (possibly none).

Example 1:

Input: n = 2, m = 1, hBars = [2,3], vBars = [2]
Output: 4
Explanation: The left image shows the initial grid formed by the bars.
The horizontal bars are in the range [1,4], and the vertical bars are in the range [1,3].
It is allowed to remove horizontal bars [2,3] and the vertical bar [2].
One way to get the maximum square-shaped hole is by removing horizontal bar 2 and vertical bar 2.
The resulting grid is shown on the right.
The hole has an area of 4.
It can be shown that it is not possible to get a square hole with an area more than 4.
Hence, the answer is 4.

Example 2:

Input: n = 1, m = 1, hBars = [2], vBars = [2]
Output: 4
Explanation: The left image shows the initial grid formed by the bars.
The horizontal bars are in the range [1,3], and the vertical bars are in the range [1,3].
It is allowed to remove the horizontal bar [2] and the vertical bar [2].
To get the maximum square-shaped hole, we remove horizontal bar 2 and vertical bar 2.
The resulting grid is shown on the right.
The hole has an area of 4.
Hence, the answer is 4, and it is the maximum possible.

Example 3:

Input: n = 2, m = 3, hBars = [2,3], vBars = [2,3,4]
Output: 9
Explanation: The left image shows the initial grid formed by the bars.
The horizontal bars are in the range [1,4], and the vertical bars are in the range [1,5].
It is allowed to remove horizontal bars [2,3] and vertical bars [2,3,4].
One way to get the maximum square-shaped hole is by removing horizontal bars 2 and 3, and vertical bars 3 and 4.
The resulting grid is shown on the right.
The hole has an area of 9.
It can be shown that it is not possible to get a square hole with an area more than 9.
Hence, the answer is 9.

Constraints:

1 <= n <= 109
1 <= m <= 109
1 <= hBars.length <= 100
2 <= hBars[i] <= n + 1
1 <= vBars.length <= 100
2 <= vBars[i] <= m + 1
All values in hBars are distinct.
All values in vBars are distinct.

Please complete the code below to solve above prblem:
```python
class Solution:
    def maximizeSquareHoleArea(self, n: int, m: int, hBars: List[int], vBars: List[int]) -> int:

```

my_solution = Solution()

test_input = { "n": 2, "m": 1, "hBars": [2,3], "vBars": [2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 1, "m": 1, "hBars": [2], "vBars": [2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 2, "m": 3, "hBars": [2,3], "vBars": [2,3,4] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 1, "m": 5, "hBars": [2], "vBars": [2,3] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 2, "m": 4, "hBars": [3,2], "vBars": [4,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 1, "m": 4, "hBars": [2], "vBars": [2,3,5,4] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 1, "m": 4, "hBars": [2], "vBars": [4,3,2,5] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 3, "m": 2, "hBars": [3,2,4], "vBars": [3,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 3, "m": 2, "hBars": [4,2,3], "vBars": [3,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 14, "m": 4, "hBars": [13], "vBars": [3,4,5,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 19, "m": 7, "hBars": [6,12,4], "vBars": [6,3] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 2, "m": 4, "hBars": [2,3], "vBars": [4,2,3,5] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 4, "m": 2, "hBars": [2,5,4,3], "vBars": [3,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 5, "m": 1, "hBars": [2,4,3,6,5], "vBars": [2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 1, "m": 6, "hBars": [2], "vBars": [3,2,7,4,6,5] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 1, "m": 13, "hBars": [2], "vBars": [4,14,2,12,11,3] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 2, "m": 5, "hBars": [2,3], "vBars": [6,2,5,4,3] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 5, "m": 2, "hBars": [2,3,6,4,5], "vBars": [2,3] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 6, "m": 1, "hBars": [7,4,3,2,5,6], "vBars": [2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 4, "m": 4, "hBars": [2,3,4,5], "vBars": [5,4,3,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 25

test_input = { "n": 4, "m": 4, "hBars": [3,4,2,5], "vBars": [2,5,3,4] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 25

test_input = { "n": 6, "m": 2, "hBars": [7,3,5,4,6,2], "vBars": [3,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 7, "m": 11, "hBars": [7,4,5,2,8,6,3], "vBars": [4] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 1, "m": 8, "hBars": [2], "vBars": [9,7,8,2,5,6,4,3] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 1, "m": 9, "hBars": [2], "vBars": [5,2,10,4,3,6,8,7] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 2, "m": 7, "hBars": [2,3], "vBars": [2,5,6,8,7,3,4] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 2, "m": 7, "hBars": [2,3], "vBars": [2,8,6,7,5,3,4] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 4, "m": 5, "hBars": [3,2,4,5], "vBars": [4,3,6,5,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 25

test_input = { "n": 4, "m": 5, "hBars": [5,3,4,2], "vBars": [5,3,6,4,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 25

test_input = { "n": 4, "m": 40, "hBars": [5,3,2,4], "vBars": [36,41,6,34,33] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 8, "m": 1, "hBars": [4,7,9,8,6,2,3,5], "vBars": [2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 11, "m": 6, "hBars": [8,9,6], "vBars": [5,3,6,4,2,7] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 22, "m": 50, "hBars": [6,19,8,17,23], "vBars": [51,3,32,44] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 27, "m": 2, "hBars": [2,26,28,22,4,8,23], "vBars": [3,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 1, "m": 9, "hBars": [2], "vBars": [3,6,10,4,8,5,9,7,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 1, "m": 9, "hBars": [2], "vBars": [3,7,5,9,10,2,4,8,6] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 3, "m": 7, "hBars": [2,4,3], "vBars": [5,4,2,3,7,6,8] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 16

test_input = { "n": 3, "m": 7, "hBars": [4,3,2], "vBars": [2,7,3,6,5,4,8] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 16

test_input = { "n": 3, "m": 7, "hBars": [4,3,2], "vBars": [3,7,5,2,6,4,8] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 16

test_input = { "n": 3, "m": 7, "hBars": [4,3,2], "vBars": [8,2,5,3,6,4,7] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 16

test_input = { "n": 3, "m": 13, "hBars": [2,4,3], "vBars": [4,6,7,12,10,13,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 4, "m": 6, "hBars": [2,3,4,5], "vBars": [7,2,4,6,3,5] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 25

test_input = { "n": 5, "m": 5, "hBars": [4,6,5,2,3], "vBars": [2,4,5,6,3] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 36

test_input = { "n": 7, "m": 3, "hBars": [8,6,4,5,7,2,3], "vBars": [4,3,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 16

test_input = { "n": 8, "m": 2, "hBars": [4,2,6,8,7,5,3,9], "vBars": [3,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 9, "m": 1, "hBars": [2,9,3,10,4,6,7,8,5], "vBars": [2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 9, "m": 1, "hBars": [9,5,4,8,7,10,3,2,6], "vBars": [2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 12, "m": 5, "hBars": [10,9,13,6,3], "vBars": [3,4,2,5,6] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 29, "m": 2, "hBars": [25,14,11,29,7,10,16,8], "vBars": [2,3] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 1, "m": 10, "hBars": [2], "vBars": [3,4,6,8,5,7,9,10,11,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 1, "m": 10, "hBars": [2], "vBars": [10,6,5,7,4,3,11,8,9,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 2, "m": 9, "hBars": [2,3], "vBars": [6,7,9,3,10,2,5,4,8] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 2, "m": 9, "hBars": [3,2], "vBars": [4,8,2,6,7,3,5,9,10] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 4, "m": 7, "hBars": [5,4,3,2], "vBars": [8,7,5,2,4,3,6] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 25

test_input = { "n": 5, "m": 6, "hBars": [2,6,5,3,4], "vBars": [4,2,5,3,7,6] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 36

test_input = { "n": 5, "m": 6, "hBars": [5,3,6,2,4], "vBars": [5,7,2,4,3,6] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 36

test_input = { "n": 5, "m": 6, "hBars": [6,4,3,5,2], "vBars": [2,4,5,7,6,3] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 36

test_input = { "n": 5, "m": 11, "hBars": [4,2,6,3,5], "vBars": [8,11,10,12,6,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 16

test_input = { "n": 6, "m": 5, "hBars": [4,5,3,2,7,6], "vBars": [6,3,5,4,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 36

test_input = { "n": 6, "m": 5, "hBars": [5,2,3,7,4,6], "vBars": [6,2,4,3,5] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 36

test_input = { "n": 6, "m": 5, "hBars": [6,3,4,2,7,5], "vBars": [2,5,4,3,6] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 36

test_input = { "n": 6, "m": 5, "hBars": [7,2,3,4,5,6], "vBars": [6,5,4,2,3] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 36

test_input = { "n": 8, "m": 3, "hBars": [4,6,9,3,8,2,7,5], "vBars": [2,4,3] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 16

test_input = { "n": 8, "m": 3, "hBars": [5,6,9,3,2,4,8,7], "vBars": [2,4,3] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 16

test_input = { "n": 8, "m": 3, "hBars": [8,6,4,3,7,2,9,5], "vBars": [4,2,3] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 16

test_input = { "n": 8, "m": 3, "hBars": [9,2,7,6,8,3,4,5], "vBars": [4,2,3] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 16

test_input = { "n": 9, "m": 2, "hBars": [5,4,6,8,9,10,2,3,7], "vBars": [3,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 9, "m": 2, "hBars": [6,3,5,4,8,9,2,10,7], "vBars": [3,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 10, "m": 1, "hBars": [4,3,10,2,11,5,6,9,8,7], "vBars": [2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 1, "m": 11, "hBars": [2], "vBars": [7,12,6,3,4,9,5,10,11,2,8] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 2, "m": 10, "hBars": [2,3], "vBars": [11,10,2,8,7,5,6,9,3,4] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 4, "m": 8, "hBars": [5,2,3,4], "vBars": [8,7,5,9,4,2,3,6] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 25

test_input = { "n": 5, "m": 7, "hBars": [2,3,6,4,5], "vBars": [6,8,4,5,3,7,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 36

test_input = { "n": 6, "m": 10, "hBars": [2,4,3,6,5,7], "vBars": [11,3,9,6,10,4] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 16

test_input = { "n": 10, "m": 2, "hBars": [8,5,4,3,10,2,11,9,6,7], "vBars": [3,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 11, "m": 1, "hBars": [2,6,9,7,5,11,3,10,4,12,8], "vBars": [2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 44, "m": 2, "hBars": [5,16,18,28,3,9,6,35,14,10], "vBars": [3,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 1, "m": 12, "hBars": [2], "vBars": [12,9,3,13,7,2,6,11,10,8,4,5] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 2, "m": 11, "hBars": [2,3], "vBars": [3,7,2,5,12,9,10,4,8,11,6] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 2, "m": 11, "hBars": [2,3], "vBars": [12,10,6,7,2,3,5,11,4,8,9] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 5, "m": 8, "hBars": [2,4,6,3,5], "vBars": [8,7,9,4,2,5,6,3] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 36

test_input = { "n": 6, "m": 7, "hBars": [5,4,6,3,2,7], "vBars": [4,7,6,5,2,8,3] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 49

test_input = { "n": 6, "m": 7, "hBars": [6,3,2,7,4,5], "vBars": [6,7,5,2,3,4,8] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 49

test_input = { "n": 8, "m": 5, "hBars": [7,4,3,9,2,8,6,5], "vBars": [5,2,6,3,4] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 36

test_input = { "n": 9, "m": 4, "hBars": [4,5,6,10,7,2,3,9,8], "vBars": [5,3,2,4] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 25

test_input = { "n": 9, "m": 4, "hBars": [9,6,3,10,2,8,4,5,7], "vBars": [4,3,2,5] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 25

test_input = { "n": 10, "m": 3, "hBars": [5,4,9,8,3,6,11,2,10,7], "vBars": [4,3,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 16

test_input = { "n": 10, "m": 6, "hBars": [6,2,8,3,11,9,10,7,4,5], "vBars": [6,2,5] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 11, "m": 2, "hBars": [8,12,9,3,5,2,10,6,7,4,11], "vBars": [3,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 28, "m": 31, "hBars": [29,24,4], "vBars": [22,24,2,14,26,4,29,13,15,25] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 1, "m": 13, "hBars": [2], "vBars": [9,5,2,6,8,11,7,10,3,13,14,4,12] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 4

test_input = { "n": 2, "m": 12, "hBars": [3,2], "vBars": [13,2,7,4,12,9,10,3,6,5,8,11] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 2, "m": 12, "hBars": [3,2], "vBars": [13,4,7,8,3,2,11,12,5,9,6,10] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 9

test_input = { "n": 5, "m": 9, "hBars": [2,5,6,3,4], "vBars": [2,7,3,9,4,10,8,6,5] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 36

test_input = { "n": 6, "m": 9, "hBars": [4,2,5,7,6,3], "vBars": [4,2,6,8,10,3,7,5] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 49

test_input = { "n": 8, "m": 6, "hBars": [4,8,6,7,2,9,3,5], "vBars": [4,7,6,3,2,5] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 49

test_input = { "n": 9, "m": 5, "hBars": [2,5,4,8,3,7,6,10,9], "vBars": [6,3,5,2,4] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 36

test_input = { "n": 9, "m": 5, "hBars": [8,9,5,2,6,7,4,10,3], "vBars": [6,2,3,4,5] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 36

test_input = { "n": 10, "m": 4, "hBars": [4,8,6,3,10,2,7,9,5,11], "vBars": [5,4,3,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 25

test_input = { "n": 11, "m": 3, "hBars": [2,8,5,3,12,10,4,11,6,7,9], "vBars": [3,4,2] }
assert my_solution.maximizeSquareHoleArea(**test_input) == 16


minimum-number-of-coins-for-fruits

Minimum Number of Coins for Fruits

Prompt:
"""
You are at a fruit market with different types of exotic fruits on display.
You are given a 1-indexed array prices, where prices[i] denotes the number of coins needed to purchase the ith fruit.
The fruit market has the following offer:

If you purchase the ith fruit at prices[i] coins, you can get the next i fruits for free.

Note that even if you can take fruit j for free, you can still purchase it for prices[j] coins to receive a new offer.
Return the minimum number of coins needed to acquire all the fruits.

Example 1:

Input: prices = [3,1,2]
Output: 4
Explanation: You can acquire the fruits as follows:
- Purchase the 1st fruit with 3 coins, you are allowed to take the 2nd fruit for free.
- Purchase the 2nd fruit with 1 coin, you are allowed to take the 3rd fruit for free.
- Take the 3rd fruit for free.
Note that even though you were allowed to take the 2nd fruit for free, you purchased it because it is more optimal.
It can be proven that 4 is the minimum number of coins needed to acquire all the fruits.

Example 2:

Input: prices = [1,10,1,1]
Output: 2
Explanation: You can acquire the fruits as follows:
- Purchase the 1st fruit with 1 coin, you are allowed to take the 2nd fruit for free.
- Take the 2nd fruit for free.
- Purchase the 3rd fruit for 1 coin, you are allowed to take the 4th fruit for free.
- Take the 4th fruit for free.
It can be proven that 2 is the minimum number of coins needed to acquire all the fruits.

Constraints:

1 <= prices.length <= 1000
1 <= prices[i] <= 105
"""
class Solution:
    def minimumCoins(self, prices: List[int]) -> int:

You are at a fruit market with different types of exotic fruits on display.
You are given a 1-indexed array prices, where prices[i] denotes the number of coins needed to purchase the ith fruit.
The fruit market has the following offer:

If you purchase the ith fruit at prices[i] coins, you can get the next i fruits for free.

Note that even if you can take fruit j for free, you can still purchase it for prices[j] coins to receive a new offer.
Return the minimum number of coins needed to acquire all the fruits.

Example 1:

Input: prices = [3,1,2]
Output: 4
Explanation: You can acquire the fruits as follows:
- Purchase the 1st fruit with 3 coins, you are allowed to take the 2nd fruit for free.
- Purchase the 2nd fruit with 1 coin, you are allowed to take the 3rd fruit for free.
- Take the 3rd fruit for free.
Note that even though you were allowed to take the 2nd fruit for free, you purchased it because it is more optimal.
It can be proven that 4 is the minimum number of coins needed to acquire all the fruits.

Example 2:

Input: prices = [1,10,1,1]
Output: 2
Explanation: You can acquire the fruits as follows:
- Purchase the 1st fruit with 1 coin, you are allowed to take the 2nd fruit for free.
- Take the 2nd fruit for free.
- Purchase the 3rd fruit for 1 coin, you are allowed to take the 4th fruit for free.
- Take the 4th fruit for free.
It can be proven that 2 is the minimum number of coins needed to acquire all the fruits.

Constraints:

1 <= prices.length <= 1000
1 <= prices[i] <= 105

Please complete the code below to solve above prblem:
```python
class Solution:
    def minimumCoins(self, prices: List[int]) -> int:

```

my_solution = Solution()

test_input = { "prices": [3,1,2] }
assert my_solution.minimumCoins(**test_input) == 4

test_input = { "prices": [1,10,1,1] }
assert my_solution.minimumCoins(**test_input) == 2

test_input = { "prices": [26,18,6,12,49,7,45,45] }
assert my_solution.minimumCoins(**test_input) == 39

test_input = { "prices": [27,17,29,45,3,39,42,26] }
assert my_solution.minimumCoins(**test_input) == 47

test_input = { "prices": [14,37,37,38,24,15,12] }
assert my_solution.minimumCoins(**test_input) == 63

test_input = { "prices": [1,37,19,38,11,42,18,33,6,37,15,48,23,12,41,18,27,32] }
assert my_solution.minimumCoins(**test_input) == 37

test_input = { "prices": [38,23,27,32,47,45,48,24,39,26,37,42,24,45,27,26,15,16,26,6] }
assert my_solution.minimumCoins(**test_input) == 132

test_input = { "prices": [45,44,5,9,22,14,29,14,21,13,45,10,2,16,14,30,26,1,49] }
assert my_solution.minimumCoins(**test_input) == 66

test_input = { "prices": [37,42,6,50,50,38,30,38,1,13,25,39,18,1,35,32,12] }
assert my_solution.minimumCoins(**test_input) == 74

test_input = { "prices": [17,32,11,25,22] }
assert my_solution.minimumCoins(**test_input) == 28

test_input = { "prices": [18,10,1,11,6,30,19,24,1,18,37,29,28,27,38] }
assert my_solution.minimumCoins(**test_input) == 26

test_input = { "prices": [3,10,25,47,49,10,49] }
assert my_solution.minimumCoins(**test_input) == 38

test_input = { "prices": [46,7,15] }
assert my_solution.minimumCoins(**test_input) == 53

test_input = { "prices": [16,45,25,5,18,19,25,13,33] }
assert my_solution.minimumCoins(**test_input) == 59

test_input = { "prices": [21,16,7,10,30] }
assert my_solution.minimumCoins(**test_input) == 28

test_input = { "prices": [21,22,29,37,23,15,39,9,19,10,6,9,33,28,43] }
assert my_solution.minimumCoins(**test_input) == 71

test_input = { "prices": [37,16,42,47,16,31,39,8,26,50,33] }
assert my_solution.minimumCoins(**test_input) == 77

test_input = { "prices": [32,4] }
assert my_solution.minimumCoins(**test_input) == 32

test_input = { "prices": [31,9,2,36,4,45,28,28,12,22,44,17,10,48,15,22,7,14,41] }
assert my_solution.minimumCoins(**test_input) == 56

test_input = { "prices": [1,31,9,36,44,2,23] }
assert my_solution.minimumCoins(**test_input) == 12

test_input = { "prices": [3,7,2,36,33,7,21,40,19] }
assert my_solution.minimumCoins(**test_input) == 12

test_input = { "prices": [9,4,7,29,22,50] }
assert my_solution.minimumCoins(**test_input) == 16

test_input = { "prices": [28,2,40,15] }
assert my_solution.minimumCoins(**test_input) == 30

test_input = { "prices": [16,17,47,20,18,37] }
assert my_solution.minimumCoins(**test_input) == 51

test_input = { "prices": [42,6,44,47,11,6,30,38,41,43,46,35,28,4,47,1,7,35] }
assert my_solution.minimumCoins(**test_input) == 93

test_input = { "prices": [10,10,5,8,5,13,34,31,36] }
assert my_solution.minimumCoins(**test_input) == 20

test_input = { "prices": [12,20,14,46,22,1,42,50,47,47,38,37,13] }
assert my_solution.minimumCoins(**test_input) == 40

test_input = { "prices": [1,38,28,46,18,22,12,7,44,44,40,36,41,5,33,5,30,33,31] }
assert my_solution.minimumCoins(**test_input) == 46

test_input = { "prices": [6,45,2,29,44,14,44] }
assert my_solution.minimumCoins(**test_input) == 22

test_input = { "prices": [34,13,50,42,24,47,41,8,26,34,3,48,39,24,39,26,46] }
assert my_solution.minimumCoins(**test_input) == 74

test_input = { "prices": [47,9,33,6,33,40,28,37,49,39,45,14,13,40,17,14,39,12,15,6] }
assert my_solution.minimumCoins(**test_input) == 103

test_input = { "prices": [32] }
assert my_solution.minimumCoins(**test_input) == 32

test_input = { "prices": [35,46,50,35,11,14,44,17,45,23,34,33,8,27,19,7,10,12,14] }
assert my_solution.minimumCoins(**test_input) == 107

test_input = { "prices": [50,45,14,24,18,15,9,14] }
assert my_solution.minimumCoins(**test_input) == 73

test_input = { "prices": [38,19,18,15,20,43,18,9,44,26,29] }
assert my_solution.minimumCoins(**test_input) == 74

test_input = { "prices": [26,21,7,40,37,44,13,3,10,9,15,12,30,18,31,10,23] }
assert my_solution.minimumCoins(**test_input) == 55

test_input = { "prices": [36,50] }
assert my_solution.minimumCoins(**test_input) == 36

test_input = { "prices": [1,32,48,36,26,5,30,25,2,17,26,39,17,46,34,47,43,45,20,48] }
assert my_solution.minimumCoins(**test_input) == 71

test_input = { "prices": [19,24,31,24] }
assert my_solution.minimumCoins(**test_input) == 43

test_input = { "prices": [1,18,25,29,17,9,3,29,23,17,18] }
assert my_solution.minimumCoins(**test_input) == 29

test_input = { "prices": [18,36,18,44,30,8,42,33,45,19,50,19,24,48] }
assert my_solution.minimumCoins(**test_input) == 63

test_input = { "prices": [26,25,47,36,9,31,1,29,29,42,29,42,36,19,45,4,11,7] }
assert my_solution.minimumCoins(**test_input) == 80

test_input = { "prices": [24,34,47,12,24,48,14,30,28,43,35,45,11,11,35,38] }
assert my_solution.minimumCoins(**test_input) == 95

test_input = { "prices": [29,18,2,6,47,32,27,12,38,17] }
assert my_solution.minimumCoins(**test_input) == 49

test_input = { "prices": [3,31,15,18,47,18,2,27,24,6,36,35,41,21,30] }
assert my_solution.minimumCoins(**test_input) == 26

test_input = { "prices": [29,45,8,45,23,35] }
assert my_solution.minimumCoins(**test_input) == 37

test_input = { "prices": [39,37] }
assert my_solution.minimumCoins(**test_input) == 39

test_input = { "prices": [18,45,6,14,41,41] }
assert my_solution.minimumCoins(**test_input) == 24

test_input = { "prices": [50,21,38,2,32,49,32,40,41,34,33,40,36,16,29,34,42,40,46] }
assert my_solution.minimumCoins(**test_input) == 121

test_input = { "prices": [28,17,42,20,6,26,47,6,23] }
assert my_solution.minimumCoins(**test_input) == 51

test_input = { "prices": [37,27,17,40,50,35,16,4,28,5,27,13,46,7,23,27] }
assert my_solution.minimumCoins(**test_input) == 74

test_input = { "prices": [11,5,40,16,20,38] }
assert my_solution.minimumCoins(**test_input) == 32

test_input = { "prices": [16,27,5,38,12,24,7,49,40,13,38,13,34,38,37,2,4,44] }
assert my_solution.minimumCoins(**test_input) == 41

test_input = { "prices": [25,9,49,19,33] }
assert my_solution.minimumCoins(**test_input) == 53

test_input = { "prices": [47,23,46,13,26,44,43,22,43,24,13,20,6,16,8,26] }
assert my_solution.minimumCoins(**test_input) == 105

test_input = { "prices": [8,1,1] }
assert my_solution.minimumCoins(**test_input) == 9

test_input = { "prices": [47,45,2,25,7,46] }
assert my_solution.minimumCoins(**test_input) == 49

test_input = { "prices": [4,31,50,45,5,50] }
assert my_solution.minimumCoins(**test_input) == 40

test_input = { "prices": [30,41,1,49,9,49,41,27,41,14,23,3,46,40,37,28,45,19,36,49] }
assert my_solution.minimumCoins(**test_input) == 54

test_input = { "prices": [6,3,49,28,31,36,5,50,39] }
assert my_solution.minimumCoins(**test_input) == 40

test_input = { "prices": [37,2,19,36,26,27,3,23,10,20,33,8,39,6,28] }
assert my_solution.minimumCoins(**test_input) == 65

test_input = { "prices": [37,34,12,30,43,35,6,21,47,38,14,31,49,11,14] }
assert my_solution.minimumCoins(**test_input) == 66

test_input = { "prices": [49,6,12,35,17,17,2] }
assert my_solution.minimumCoins(**test_input) == 63

test_input = { "prices": [45,27,43,34,41,30,28,45,24,50,20,4,15,42] }
assert my_solution.minimumCoins(**test_input) == 116

test_input = { "prices": [48,22,36] }
assert my_solution.minimumCoins(**test_input) == 70

test_input = { "prices": [47,13,23,31,41,25] }
assert my_solution.minimumCoins(**test_input) == 70

test_input = { "prices": [3,44,17,37,9,14,37] }
assert my_solution.minimumCoins(**test_input) == 29

test_input = { "prices": [4,43,7,15,38] }
assert my_solution.minimumCoins(**test_input) == 11

test_input = { "prices": [10,25,7,37,6,43,4,50,9,14,36,35,36,44,17,10,44,46,50] }
assert my_solution.minimumCoins(**test_input) == 35

test_input = { "prices": [45,28,10,18,18,3,42,24,14,11,13,32,37,31,50,32] }
assert my_solution.minimumCoins(**test_input) == 69

test_input = { "prices": [12,38,44,24,42,9,32,40,8,20,46,39,33] }
assert my_solution.minimumCoins(**test_input) == 73

test_input = { "prices": [5,42,30,20,37,26,38,30,30,32,39,31,33,41,23,4,29] }
assert my_solution.minimumCoins(**test_input) == 85

test_input = { "prices": [44,22] }
assert my_solution.minimumCoins(**test_input) == 44

test_input = { "prices": [8,8,11,21,9] }
assert my_solution.minimumCoins(**test_input) == 19

test_input = { "prices": [2,37,19,30,37,27,10,37] }
assert my_solution.minimumCoins(**test_input) == 31

test_input = { "prices": [43,27,48,22] }
assert my_solution.minimumCoins(**test_input) == 70

test_input = { "prices": [50,23,37,49,45,14,18,39,50,7,31] }
assert my_solution.minimumCoins(**test_input) == 101

test_input = { "prices": [37,3,32,25,21,22,26,49,14,45,1,36] }
assert my_solution.minimumCoins(**test_input) == 62

test_input = { "prices": [21,29,31,28,2,41,4,43,41,16,38,33,3,6,43,22,15] }
assert my_solution.minimumCoins(**test_input) == 59

test_input = { "prices": [24,47,32,41,35,14,18,23,27,8,27] }
assert my_solution.minimumCoins(**test_input) == 70

test_input = { "prices": [40,25,32] }
assert my_solution.minimumCoins(**test_input) == 65

test_input = { "prices": [9,18,2,26,15,3,2,33,46,6,11,34,27,7,5,7,26,13,48] }
assert my_solution.minimumCoins(**test_input) == 18

test_input = { "prices": [41,8,38,32,36,30,23,49,40,46,42,34,2,12,12,19,20,50,40] }
assert my_solution.minimumCoins(**test_input) == 104

test_input = { "prices": [28,8,24,14,34,36,48] }
assert my_solution.minimumCoins(**test_input) == 50

test_input = { "prices": [2,36,22,41,42,26,1,48,14,27,22,26] }
assert my_solution.minimumCoins(**test_input) == 25

test_input = { "prices": [25,39,21,21,16] }
assert my_solution.minimumCoins(**test_input) == 46

test_input = { "prices": [44,41,36,42,21,32,45,5] }
assert my_solution.minimumCoins(**test_input) == 101

test_input = { "prices": [10] }
assert my_solution.minimumCoins(**test_input) == 10

test_input = { "prices": [35,29] }
assert my_solution.minimumCoins(**test_input) == 35

test_input = { "prices": [38,35,33,11,43,33] }
assert my_solution.minimumCoins(**test_input) == 71

test_input = { "prices": [19,29,49,20,8,12,13,28,45,9,12,3,1,17,35] }
assert my_solution.minimumCoins(**test_input) == 65

test_input = { "prices": [34,22,1,41,34,27,18] }
assert my_solution.minimumCoins(**test_input) == 53

test_input = { "prices": [31,9,39,6,14,32,28,35,34,42,19,41,35,24,32,16,12,49,16] }
assert my_solution.minimumCoins(**test_input) == 73

test_input = { "prices": [46,50,21,14,26,47] }
assert my_solution.minimumCoins(**test_input) == 67

test_input = { "prices": [5,22,36,6,15,49,20,16,36,15,32,27,50,19,12,22,9,33] }
assert my_solution.minimumCoins(**test_input) == 57

test_input = { "prices": [17,4,36,4,32,11,42,12,20] }
assert my_solution.minimumCoins(**test_input) == 36

test_input = { "prices": [48,33,39,1,13,40] }
assert my_solution.minimumCoins(**test_input) == 82

test_input = { "prices": [32,19,33,30,32,44,47,8,10,1,23,6,28,19,20,48,12,10,20,22] }
assert my_solution.minimumCoins(**test_input) == 84

test_input = { "prices": [29,5,46,34,38,7,1,15] }
assert my_solution.minimumCoins(**test_input) == 68

test_input = { "prices": [39,50,22,1,38,22,49,16,27,48,45,28,43,34] }
assert my_solution.minimumCoins(**test_input) == 78