count-elements-with-maximum-frequency

Count Elements With Maximum Frequency

Prompt:
"""
给你一个由 正整数 组成的数组 nums 。
返回数组 nums 中所有具有 最大 频率的元素的 总频率 。
元素的 频率 是指该元素在数组中出现的次数。

示例 1：

输入：nums = [1,2,2,3,1,4]
输出：4
解释：元素 1 和 2 的频率为 2 ，是数组中的最大频率。
因此具有最大频率的元素在数组中的数量是 4 。

示例 2：

输入：nums = [1,2,3,4,5]
输出：5
解释：数组中的所有元素的频率都为 1 ，是最大频率。
因此具有最大频率的元素在数组中的数量是 5 。

提示：

1 <= nums.length <= 100
1 <= nums[i] <= 100
"""
class Solution:
    def maxFrequencyElements(self, nums: List[int]) -> int:

给你一个由 正整数 组成的数组 nums 。
返回数组 nums 中所有具有 最大 频率的元素的 总频率 。
元素的 频率 是指该元素在数组中出现的次数。

示例 1：

输入：nums = [1,2,2,3,1,4]
输出：4
解释：元素 1 和 2 的频率为 2 ，是数组中的最大频率。
因此具有最大频率的元素在数组中的数量是 4 。

示例 2：

输入：nums = [1,2,3,4,5]
输出：5
解释：数组中的所有元素的频率都为 1 ，是最大频率。
因此具有最大频率的元素在数组中的数量是 5 。

提示：

1 <= nums.length <= 100
1 <= nums[i] <= 100

请完成下面的代码来解决上述问题:
```python
class Solution:
    def maxFrequencyElements(self, nums: List[int]) -> int:

```

my_solution = Solution()

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

test_input = { "nums": [1,2,3,4,5] }
assert my_solution.maxFrequencyElements(**test_input) == 5

test_input = { "nums": [15] }
assert my_solution.maxFrequencyElements(**test_input) == 1

test_input = { "nums": [10,12,11,9,6,19,11] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [2,12,17,18,11] }
assert my_solution.maxFrequencyElements(**test_input) == 5

test_input = { "nums": [19,19,19,20,19,8,19] }
assert my_solution.maxFrequencyElements(**test_input) == 5

test_input = { "nums": [1,1,1,1] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [10,1,12,10,10,19,10] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [1,1,1,20,6,1] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [17,17] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [6,13,15,15,11,6,7,12,4,11] }
assert my_solution.maxFrequencyElements(**test_input) == 6

test_input = { "nums": [1,2] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [14,14,17] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [17,17,2,12,20,17,12] }
assert my_solution.maxFrequencyElements(**test_input) == 3

test_input = { "nums": [3,9,11,11,20] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [8,15,8,11,8,13,12,11,8] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [17,8,17,19,17,13,17,17,17,5] }
assert my_solution.maxFrequencyElements(**test_input) == 6

test_input = { "nums": [11] }
assert my_solution.maxFrequencyElements(**test_input) == 1

test_input = { "nums": [5] }
assert my_solution.maxFrequencyElements(**test_input) == 1

test_input = { "nums": [4,4,10] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [15,13,2,16,2,5,1,18,8,16] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [1,17,12,7,17,3] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [8,2,8,6,1,1] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [3,9,7,9] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [20,20,20,5,12,20,9,16] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [2,14,3,8,16,4,4,3] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [6,12,3,3,11,2] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [5,2,13,19,15,20] }
assert my_solution.maxFrequencyElements(**test_input) == 6

test_input = { "nums": [2,13,13] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [4,5] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [20,20,15,20,20,20] }
assert my_solution.maxFrequencyElements(**test_input) == 5

test_input = { "nums": [16,16,16,16,1,10,16,9] }
assert my_solution.maxFrequencyElements(**test_input) == 5

test_input = { "nums": [5,3,5,8,5,3,5,15] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [17] }
assert my_solution.maxFrequencyElements(**test_input) == 1

test_input = { "nums": [2,2,3,3,9] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [5,11,4,2] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [13,13,7] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [2,15,10,10,10,4,13] }
assert my_solution.maxFrequencyElements(**test_input) == 3

test_input = { "nums": [3,7,1] }
assert my_solution.maxFrequencyElements(**test_input) == 3

test_input = { "nums": [19,6,19,19,19,19,19] }
assert my_solution.maxFrequencyElements(**test_input) == 6

test_input = { "nums": [15,3,12,4,9,14,10] }
assert my_solution.maxFrequencyElements(**test_input) == 7

test_input = { "nums": [1,19,12,1,12,12,1,6] }
assert my_solution.maxFrequencyElements(**test_input) == 6

test_input = { "nums": [17,7,3,3,6,5,6,2] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [12,4,2,9,17,14,1,12,6] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [16,11] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [11,11,11,11,10,11,3,11,11] }
assert my_solution.maxFrequencyElements(**test_input) == 7

test_input = { "nums": [16,4,20,10,12] }
assert my_solution.maxFrequencyElements(**test_input) == 5

test_input = { "nums": [3,11,3,11] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [13,9,13,13,13,13,2,13] }
assert my_solution.maxFrequencyElements(**test_input) == 6

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

test_input = { "nums": [19,6,9,12,12] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [20] }
assert my_solution.maxFrequencyElements(**test_input) == 1

test_input = { "nums": [1,11] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [6,4,7,19,20,10,13,14] }
assert my_solution.maxFrequencyElements(**test_input) == 8

test_input = { "nums": [16,8,5] }
assert my_solution.maxFrequencyElements(**test_input) == 3

test_input = { "nums": [15,15,4,7,15,15,15,15,15,7] }
assert my_solution.maxFrequencyElements(**test_input) == 7

test_input = { "nums": [5,20] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [13] }
assert my_solution.maxFrequencyElements(**test_input) == 1

test_input = { "nums": [7,15,13,18,3,11,13,7,1,13] }
assert my_solution.maxFrequencyElements(**test_input) == 3

test_input = { "nums": [17,5,17,5,5] }
assert my_solution.maxFrequencyElements(**test_input) == 3

test_input = { "nums": [4,5,3,5] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [11,2] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [1,17,17,20,2,2] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [2,5,2,2] }
assert my_solution.maxFrequencyElements(**test_input) == 3

test_input = { "nums": [1,1,1,3,8,1] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [1,19,19,5,14,13,1,20,6] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [19,12,8,20,3,1,12,17] }
assert my_solution.maxFrequencyElements(**test_input) == 2

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

test_input = { "nums": [8,8,8,3,8,8,3] }
assert my_solution.maxFrequencyElements(**test_input) == 5

test_input = { "nums": [5,1,2,2,2,1,1] }
assert my_solution.maxFrequencyElements(**test_input) == 6

test_input = { "nums": [12,13,6] }
assert my_solution.maxFrequencyElements(**test_input) == 3

test_input = { "nums": [18,12,8,2,16,19] }
assert my_solution.maxFrequencyElements(**test_input) == 6

test_input = { "nums": [15,10,2,18,11,14,9] }
assert my_solution.maxFrequencyElements(**test_input) == 7

test_input = { "nums": [19,17,9,13,1,13] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [4,12,15,1,4,4,2] }
assert my_solution.maxFrequencyElements(**test_input) == 3

test_input = { "nums": [16,16,16,8] }
assert my_solution.maxFrequencyElements(**test_input) == 3

test_input = { "nums": [2] }
assert my_solution.maxFrequencyElements(**test_input) == 1

test_input = { "nums": [13,15,1] }
assert my_solution.maxFrequencyElements(**test_input) == 3

test_input = { "nums": [10,10,5,16,17,6,18] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [3,2,14,2,18,7] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [16,16,3] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [1,8,10,11,8,15] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [8,19,2,7,5,6,3,4] }
assert my_solution.maxFrequencyElements(**test_input) == 8

test_input = { "nums": [9] }
assert my_solution.maxFrequencyElements(**test_input) == 1

test_input = { "nums": [13,6,13,10] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [14,13,14,4,4,14] }
assert my_solution.maxFrequencyElements(**test_input) == 3

test_input = { "nums": [9,9,1,9,9,1] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [14,4,11,14,14,4,4] }
assert my_solution.maxFrequencyElements(**test_input) == 6

test_input = { "nums": [4,20,20,4,1] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [5,11,8,3,11,11,11] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [3,2,18,5] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [3,8,20,7,16,20,18,13] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [19,9,16,4,10,3,18] }
assert my_solution.maxFrequencyElements(**test_input) == 7

test_input = { "nums": [11,2,2,3,19,3,11,2,14,1] }
assert my_solution.maxFrequencyElements(**test_input) == 3

test_input = { "nums": [19,14,11,7,19,1,11,2,16] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [18,15,3,2,8,12,19,14,12] }
assert my_solution.maxFrequencyElements(**test_input) == 2

test_input = { "nums": [5,6,11,9,5,5,5] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [8,4,4,12,8,1] }
assert my_solution.maxFrequencyElements(**test_input) == 4

test_input = { "nums": [9,1,9,9,3] }
assert my_solution.maxFrequencyElements(**test_input) == 3

test_input = { "nums": [18] }
assert my_solution.maxFrequencyElements(**test_input) == 1


find-beautiful-indices-in-the-given-array-i

Find Beautiful Indices in the Given Array I

Prompt:
"""
给你一个下标从 0 开始的字符串 s 、字符串 a 、字符串 b 和一个整数 k 。
如果下标 i 满足以下条件，则认为它是一个 美丽下标：

0 <= i <= s.length - a.length
s[i..(i + a.length - 1)] == a
存在下标 j 使得：

0 <= j <= s.length - b.length
s[j..(j + b.length - 1)] == b
|j - i| <= k

以数组形式按 从小到大排序 返回美丽下标。

示例 1：

输入：s = "isawsquirrelnearmysquirrelhouseohmy", a = "my", b = "squirrel", k = 15
输出：[16,33]
解释：存在 2 个美丽下标：[16,33]。
- 下标 16 是美丽下标，因为 s[16..17] == "my" ，且存在下标 4 ，满足 s[4..11] == "squirrel" 且 |16 - 4| <= 15 。
- 下标 33 是美丽下标，因为 s[33..34] == "my" ，且存在下标 18 ，满足 s[18..25] == "squirrel" 且 |33 - 18| <= 15 。
因此返回 [16,33] 作为结果。

示例 2：

输入：s = "abcd", a = "a", b = "a", k = 4
输出：[0]
解释：存在 1 个美丽下标：[0]。
- 下标 0 是美丽下标，因为 s[0..0] == "a" ，且存在下标 0 ，满足 s[0..0] == "a" 且 |0 - 0| <= 4 。
因此返回 [0] 作为结果。

提示：

1 <= k <= s.length <= 105
1 <= a.length, b.length <= 10
s、a、和 b 只包含小写英文字母。
"""
class Solution:
    def beautifulIndices(self, s: str, a: str, b: str, k: int) -> List[int]:

给你一个下标从 0 开始的字符串 s 、字符串 a 、字符串 b 和一个整数 k 。
如果下标 i 满足以下条件，则认为它是一个 美丽下标：

0 <= i <= s.length - a.length
s[i..(i + a.length - 1)] == a
存在下标 j 使得：

0 <= j <= s.length - b.length
s[j..(j + b.length - 1)] == b
|j - i| <= k

以数组形式按 从小到大排序 返回美丽下标。

示例 1：

输入：s = "isawsquirrelnearmysquirrelhouseohmy", a = "my", b = "squirrel", k = 15
输出：[16,33]
解释：存在 2 个美丽下标：[16,33]。
- 下标 16 是美丽下标，因为 s[16..17] == "my" ，且存在下标 4 ，满足 s[4..11] == "squirrel" 且 |16 - 4| <= 15 。
- 下标 33 是美丽下标，因为 s[33..34] == "my" ，且存在下标 18 ，满足 s[18..25] == "squirrel" 且 |33 - 18| <= 15 。
因此返回 [16,33] 作为结果。

示例 2：

输入：s = "abcd", a = "a", b = "a", k = 4
输出：[0]
解释：存在 1 个美丽下标：[0]。
- 下标 0 是美丽下标，因为 s[0..0] == "a" ，且存在下标 0 ，满足 s[0..0] == "a" 且 |0 - 0| <= 4 。
因此返回 [0] 作为结果。

提示：

1 <= k <= s.length <= 105
1 <= a.length, b.length <= 10
s、a、和 b 只包含小写英文字母。

请完成下面的代码来解决上述问题:
```python
class Solution:
    def beautifulIndices(self, s: str, a: str, b: str, k: int) -> List[int]:

```

my_solution = Solution()

test_input = { "s": "isawsquirrelnearmysquirrelhouseohmy", "a": "my", "b": "squirrel", "k": 15 }
assert my_solution.beautifulIndices(**test_input) == [16,33]

test_input = { "s": "abcd", "a": "a", "b": "a", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == [0]

test_input = { "s": "sqgrt", "a": "rt", "b": "sq", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == [3]

test_input = { "s": "mquz", "a": "tklr", "b": "caz", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "wl", "a": "xjigt", "b": "wl", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "bavgoc", "a": "ba", "b": "c", "k": 6 }
assert my_solution.beautifulIndices(**test_input) == [0]

test_input = { "s": "xpcp", "a": "yxnod", "b": "xpc", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "lahhnlwx", "a": "hhnlw", "b": "ty", "k": 6 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "dexgscgecd", "a": "gscge", "b": "d", "k": 6 }
assert my_solution.beautifulIndices(**test_input) == [3]

test_input = { "s": "vjrao", "a": "vjr", "b": "yxpsw", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "oo", "a": "swhup", "b": "o", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "bxlzgxc", "a": "ducf", "b": "xlzgx", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "wetlgztzm", "a": "box", "b": "wetl", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "ocmm", "a": "m", "b": "oc", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == [2,3]

test_input = { "s": "goxmox", "a": "gibs", "b": "ox", "k": 6 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "kzlrqzldvy", "a": "zl", "b": "tfsr", "k": 9 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "qhd", "a": "hd", "b": "od", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "bozpeh", "a": "bozp", "b": "vrjn", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "ggfsg", "a": "gfsg", "b": "g", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == [1]

test_input = { "s": "fape", "a": "vq", "b": "ap", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "isitbenom", "a": "pmng", "b": "itben", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "gw", "a": "ln", "b": "gw", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "jhu", "a": "sio", "b": "xnx", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "elcklvcvdg", "a": "lck", "b": "e", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == [1]

test_input = { "s": "subsu", "a": "tdo", "b": "su", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "jqcdc", "a": "c", "b": "d", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == [2,4]

test_input = { "s": "hhvc", "a": "gfwo", "b": "hh", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "tyoq", "a": "vhjit", "b": "yoq", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "rtbp", "a": "migjb", "b": "es", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "gkkstqvl", "a": "gkkst", "b": "xszl", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "bc", "a": "spzk", "b": "wsick", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "gyalx", "a": "neet", "b": "rbhl", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "qo", "a": "agt", "b": "xrh", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "rinzbrrr", "a": "nzb", "b": "r", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == [2]

test_input = { "s": "tjly", "a": "j", "b": "n", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "frkxslnnn", "a": "rkxsl", "b": "n", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "cffczbccc", "a": "ff", "b": "c", "k": 9 }
assert my_solution.beautifulIndices(**test_input) == [1]

test_input = { "s": "uiddqbeoaw", "a": "iddq", "b": "rlr", "k": 6 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "fh", "a": "ywab", "b": "qcjyl", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "gdbm", "a": "gdbm", "b": "uefwm", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "bpcwswu", "a": "zi", "b": "pcwsw", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "dh", "a": "jmcds", "b": "nytk", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "qjgckhiif", "a": "hiif", "b": "jgc", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == [5]

test_input = { "s": "qyixufgyk", "a": "y", "b": "ixuf", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == [1,7]

test_input = { "s": "wiwiwinwio", "a": "hm", "b": "wi", "k": 8 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "ffnlge", "a": "bjt", "b": "pavkr", "k": 6 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "rj", "a": "m", "b": "umg", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "bkgqxl", "a": "yufy", "b": "kgq", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "hhcwp", "a": "sixek", "b": "cwp", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "czr", "a": "cz", "b": "wxxql", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "tdbnme", "a": "t", "b": "dbnme", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == [0]

test_input = { "s": "px", "a": "acgz", "b": "jaxel", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "wfa", "a": "fyntx", "b": "a", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "ixfkxfld", "a": "ixfk", "b": "urkke", "k": 6 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "kmjvlkjy", "a": "gll", "b": "vlk", "k": 6 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "bsbsvnmvnm", "a": "vnm", "b": "bs", "k": 7 }
assert my_solution.beautifulIndices(**test_input) == [4,7]

test_input = { "s": "uzqauzqw", "a": "uzq", "b": "psnso", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "fsvkche", "a": "yot", "b": "svkc", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "cwwzmfzz", "a": "fnlgc", "b": "cwwzm", "k": 6 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "profguo", "a": "o", "b": "oyzje", "k": 6 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "ckbdnw", "a": "djpc", "b": "ckbdn", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "ankfahcorr", "a": "r", "b": "kfah", "k": 7 }
assert my_solution.beautifulIndices(**test_input) == [8,9]

test_input = { "s": "ahjzfg", "a": "hjzf", "b": "zs", "k": 6 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "eueuau", "a": "u", "b": "e", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == [1,3,5]

test_input = { "s": "etuwwhwljf", "a": "uwwh", "b": "efcuq", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "vvjhgg", "a": "g", "b": "kj", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "igytmsmsgx", "a": "msmsg", "b": "gyt", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == [4]

test_input = { "s": "cheoeo", "a": "eo", "b": "y", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "gqzf", "a": "cgpdn", "b": "zf", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "zapqwtmx", "a": "apqwt", "b": "m", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "klxtee", "a": "e", "b": "klx", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "xa", "a": "gzsj", "b": "oooq", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "gxoxqgxoxq", "a": "gxoxq", "b": "x", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == [0,5]

test_input = { "s": "lsuo", "a": "d", "b": "uo", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "yhi", "a": "ph", "b": "yhi", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "cj", "a": "j", "b": "em", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "clxzclxz", "a": "ge", "b": "clxz", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "gjtcpyiniv", "a": "cpyi", "b": "hjvtq", "k": 9 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "kyrvedszzo", "a": "rve", "b": "y", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == [2]

test_input = { "s": "makolbcrme", "a": "qlhpf", "b": "akol", "k": 9 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "vgxshd", "a": "vgx", "b": "en", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "wfvxfzut", "a": "wfv", "b": "ut", "k": 6 }
assert my_solution.beautifulIndices(**test_input) == [0]

test_input = { "s": "xxtxxuftxt", "a": "tx", "b": "x", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == [2,7]

test_input = { "s": "cwtybs", "a": "wgfez", "b": "cwty", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "opnkctux", "a": "op", "b": "nkctu", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == [0]

test_input = { "s": "swswmcsksw", "a": "mcsk", "b": "sw", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == [4]

test_input = { "s": "qqnb", "a": "q", "b": "q", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == [0,1]

test_input = { "s": "tt", "a": "t", "b": "q", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "lllclbii", "a": "l", "b": "i", "k": 7 }
assert my_solution.beautifulIndices(**test_input) == [0,1,2,4]

test_input = { "s": "oanyzue", "a": "yzu", "b": "oan", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == [3]

test_input = { "s": "opmfgzthj", "a": "opmf", "b": "g", "k": 9 }
assert my_solution.beautifulIndices(**test_input) == [0]

test_input = { "s": "uiddidde", "a": "idd", "b": "sal", "k": 7 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "gzzau", "a": "za", "b": "rwu", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "srpxqurxx", "a": "nsr", "b": "x", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "sxaono", "a": "jy", "b": "xaon", "k": 6 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "acxtjiova", "a": "acx", "b": "tjiov", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == [0]

test_input = { "s": "iltazkww", "a": "k", "b": "z", "k": 6 }
assert my_solution.beautifulIndices(**test_input) == [5]

test_input = { "s": "ltxbhpi", "a": "cjfbb", "b": "ltxb", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "gysgysh", "a": "gys", "b": "qzvae", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "zypvgt", "a": "zypv", "b": "ljxni", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == []


maximum-number-that-sum-of-the-prices-is-less-than-or-equal-to-k

Maximum Number That Sum of the Prices Is Less Than or Equal to K

Prompt:
"""
给你一个整数k和一个整数x。
令 s为整数num的下标从 1开始的二进制表示。我们说一个整数num的 价值是满足i % x == 0 且s[i]是 设置位的 i的数目。
请你返回最大整数num，满足从 1到 num的所有整数的 价值和小于等于 k。
注意：

一个整数二进制表示下 设置位是值为 1的数位。
一个整数的二进制表示下标从右到左编号，比方说如果s == 11100，那么s[4] == 1 且s[2] == 0。

示例 1：

输入：k = 9, x = 1
输出：6
解释：数字 1 ，2 ，3 ，4 ，5 和 6 二进制表示分别为 "1" ，"10" ，"11" ，"100" ，"101" 和 "110" 。
由于 x 等于 1 ，每个数字的价值分别为所有设置位的数目。
这些数字的所有设置位数目总数是 9 ，所以前 6 个数字的价值和为 9 。
所以答案为 6 。
示例 2：

输入：k = 7, x = 2
输出：9
解释：由于 x 等于 2 ，我们检查每个数字的偶数位。
2 和 3 在二进制表示下的第二个数位为设置位，所以它们的价值和为 2 。
6 和 7 在二进制表示下的第二个数位为设置位，所以它们的价值和为 2 。
8 和 9 在二进制表示下的第四个数位为设置位但第二个数位不是设置位，所以它们的价值和为 2 。
数字 1 ，4 和 5 在二进制下偶数位都不是设置位，所以它们的价值和为 0 。
10 在二进制表示下的第二个数位和第四个数位都是设置位，所以它的价值为 2 。
前 9 个数字的价值和为 6 。
前 10 个数字的价值和为 8，超过了 k = 7 ，所以答案为 9 。

提示：

1 <= k <= 1015
1 <= x <= 8
"""
class Solution:
    def findMaximumNumber(self, k: int, x: int) -> int:

给你一个整数k和一个整数x。
令 s为整数num的下标从 1开始的二进制表示。我们说一个整数num的 价值是满足i % x == 0 且s[i]是 设置位的 i的数目。
请你返回最大整数num，满足从 1到 num的所有整数的 价值和小于等于 k。
注意：

一个整数二进制表示下 设置位是值为 1的数位。
一个整数的二进制表示下标从右到左编号，比方说如果s == 11100，那么s[4] == 1 且s[2] == 0。

示例 1：

输入：k = 9, x = 1
输出：6
解释：数字 1 ，2 ，3 ，4 ，5 和 6 二进制表示分别为 "1" ，"10" ，"11" ，"100" ，"101" 和 "110" 。
由于 x 等于 1 ，每个数字的价值分别为所有设置位的数目。
这些数字的所有设置位数目总数是 9 ，所以前 6 个数字的价值和为 9 。
所以答案为 6 。
示例 2：

输入：k = 7, x = 2
输出：9
解释：由于 x 等于 2 ，我们检查每个数字的偶数位。
2 和 3 在二进制表示下的第二个数位为设置位，所以它们的价值和为 2 。
6 和 7 在二进制表示下的第二个数位为设置位，所以它们的价值和为 2 。
8 和 9 在二进制表示下的第四个数位为设置位但第二个数位不是设置位，所以它们的价值和为 2 。
数字 1 ，4 和 5 在二进制下偶数位都不是设置位，所以它们的价值和为 0 。
10 在二进制表示下的第二个数位和第四个数位都是设置位，所以它的价值为 2 。
前 9 个数字的价值和为 6 。
前 10 个数字的价值和为 8，超过了 k = 7 ，所以答案为 9 。

提示：

1 <= k <= 1015
1 <= x <= 8

请完成下面的代码来解决上述问题:
```python
class Solution:
    def findMaximumNumber(self, k: int, x: int) -> int:

```

my_solution = Solution()

test_input = { "k": 9, "x": 1 }
assert my_solution.findMaximumNumber(**test_input) == 6

test_input = { "k": 7, "x": 2 }
assert my_solution.findMaximumNumber(**test_input) == 9

test_input = { "k": 19, "x": 6 }
assert my_solution.findMaximumNumber(**test_input) == 50

test_input = { "k": 57, "x": 4 }
assert my_solution.findMaximumNumber(**test_input) == 120

test_input = { "k": 58, "x": 5 }
assert my_solution.findMaximumNumber(**test_input) == 121

test_input = { "k": 60, "x": 8 }
assert my_solution.findMaximumNumber(**test_input) == 187

test_input = { "k": 72, "x": 5 }
assert my_solution.findMaximumNumber(**test_input) == 151

test_input = { "k": 81, "x": 6 }
assert my_solution.findMaximumNumber(**test_input) == 176

test_input = { "k": 83, "x": 1 }
assert my_solution.findMaximumNumber(**test_input) == 33

test_input = { "k": 83, "x": 7 }
assert my_solution.findMaximumNumber(**test_input) == 210

test_input = { "k": 116, "x": 5 }
assert my_solution.findMaximumNumber(**test_input) == 243

test_input = { "k": 157, "x": 6 }
assert my_solution.findMaximumNumber(**test_input) == 316

test_input = { "k": 201, "x": 3 }
assert my_solution.findMaximumNumber(**test_input) == 212

test_input = { "k": 268, "x": 6 }
assert my_solution.findMaximumNumber(**test_input) == 555

test_input = { "k": 281, "x": 5 }
assert my_solution.findMaximumNumber(**test_input) == 531

test_input = { "k": 283, "x": 3 }
assert my_solution.findMaximumNumber(**test_input) == 274

test_input = { "k": 309, "x": 4 }
assert my_solution.findMaximumNumber(**test_input) == 364

test_input = { "k": 363, "x": 7 }
assert my_solution.findMaximumNumber(**test_input) == 746

test_input = { "k": 409, "x": 2 }
assert my_solution.findMaximumNumber(**test_input) == 220

test_input = { "k": 456, "x": 7 }
assert my_solution.findMaximumNumber(**test_input) == 967

test_input = { "k": 466, "x": 3 }
assert my_solution.findMaximumNumber(**test_input) == 365

test_input = { "k": 500, "x": 3 }
assert my_solution.findMaximumNumber(**test_input) == 379

test_input = { "k": 513, "x": 1 }
assert my_solution.findMaximumNumber(**test_input) == 148

test_input = { "k": 521, "x": 8 }
assert my_solution.findMaximumNumber(**test_input) == 1160

test_input = { "k": 540, "x": 4 }
assert my_solution.findMaximumNumber(**test_input) == 571

test_input = { "k": 545, "x": 1 }
assert my_solution.findMaximumNumber(**test_input) == 156

test_input = { "k": 579, "x": 1 }
assert my_solution.findMaximumNumber(**test_input) == 165

test_input = { "k": 584, "x": 1 }
assert my_solution.findMaximumNumber(**test_input) == 166

test_input = { "k": 589, "x": 3 }
assert my_solution.findMaximumNumber(**test_input) == 427

test_input = { "k": 599, "x": 6 }
assert my_solution.findMaximumNumber(**test_input) == 1206

test_input = { "k": 632, "x": 2 }
assert my_solution.findMaximumNumber(**test_input) == 346

test_input = { "k": 692, "x": 3 }
assert my_solution.findMaximumNumber(**test_input) == 481

test_input = { "k": 701, "x": 7 }
assert my_solution.findMaximumNumber(**test_input) == 1404

test_input = { "k": 704, "x": 4 }
assert my_solution.findMaximumNumber(**test_input) == 727

test_input = { "k": 731, "x": 7 }
assert my_solution.findMaximumNumber(**test_input) == 1498

test_input = { "k": 781, "x": 1 }
assert my_solution.findMaximumNumber(**test_input) == 210

test_input = { "k": 782, "x": 7 }
assert my_solution.findMaximumNumber(**test_input) == 1613

test_input = { "k": 808, "x": 6 }
assert my_solution.findMaximumNumber(**test_input) == 1639

test_input = { "k": 814, "x": 7 }
assert my_solution.findMaximumNumber(**test_input) == 1645

test_input = { "k": 818, "x": 1 }
assert my_solution.findMaximumNumber(**test_input) == 218

test_input = { "k": 821, "x": 2 }
assert my_solution.findMaximumNumber(**test_input) == 433

test_input = { "k": 829, "x": 6 }
assert my_solution.findMaximumNumber(**test_input) == 1660

test_input = { "k": 865, "x": 7 }
assert my_solution.findMaximumNumber(**test_input) == 1760

test_input = { "k": 874, "x": 6 }
assert my_solution.findMaximumNumber(**test_input) == 1769

test_input = { "k": 879, "x": 1 }
assert my_solution.findMaximumNumber(**test_input) == 230

test_input = { "k": 879, "x": 3 }
assert my_solution.findMaximumNumber(**test_input) == 628

test_input = { "k": 898, "x": 8 }
assert my_solution.findMaximumNumber(**test_input) == 1921

test_input = { "k": 902, "x": 3 }
assert my_solution.findMaximumNumber(**test_input) == 653

test_input = { "k": 905, "x": 8 }
assert my_solution.findMaximumNumber(**test_input) == 1928

test_input = { "k": 937, "x": 8 }
assert my_solution.findMaximumNumber(**test_input) == 1960

test_input = { "k": 957, "x": 3 }
assert my_solution.findMaximumNumber(**test_input) == 701

test_input = { "k": 973, "x": 1 }
assert my_solution.findMaximumNumber(**test_input) == 247

test_input = { "k": 978, "x": 3 }
assert my_solution.findMaximumNumber(**test_input) == 737

test_input = { "k": 991, "x": 5 }
assert my_solution.findMaximumNumber(**test_input) == 1006

test_input = { "k": 1029, "x": 3 }
assert my_solution.findMaximumNumber(**test_input) == 771

test_input = { "k": 1065, "x": 6 }
assert my_solution.findMaximumNumber(**test_input) == 2083

test_input = { "k": 1086, "x": 3 }
assert my_solution.findMaximumNumber(**test_input) == 805

test_input = { "k": 1105, "x": 1 }
assert my_solution.findMaximumNumber(**test_input) == 280

test_input = { "k": 1113, "x": 3 }
assert my_solution.findMaximumNumber(**test_input) == 815

test_input = { "k": 1143, "x": 4 }
assert my_solution.findMaximumNumber(**test_input) == 1190

test_input = { "k": 1148, "x": 2 }
assert my_solution.findMaximumNumber(**test_input) == 564

test_input = { "k": 1150, "x": 7 }
assert my_solution.findMaximumNumber(**test_input) == 2301

test_input = { "k": 1156, "x": 3 }
assert my_solution.findMaximumNumber(**test_input) == 835

test_input = { "k": 1171, "x": 7 }
assert my_solution.findMaximumNumber(**test_input) == 2386

test_input = { "k": 1172, "x": 1 }
assert my_solution.findMaximumNumber(**test_input) == 297

test_input = { "k": 1227, "x": 7 }
assert my_solution.findMaximumNumber(**test_input) == 2506

test_input = { "k": 1236, "x": 8 }
assert my_solution.findMaximumNumber(**test_input) == 2515

test_input = { "k": 1270, "x": 5 }
assert my_solution.findMaximumNumber(**test_input) == 1525

test_input = { "k": 1274, "x": 6 }
assert my_solution.findMaximumNumber(**test_input) == 2220

test_input = { "k": 1281, "x": 6 }
assert my_solution.findMaximumNumber(**test_input) == 2223

test_input = { "k": 1282, "x": 6 }
assert my_solution.findMaximumNumber(**test_input) == 2224

test_input = { "k": 1288, "x": 5 }
assert my_solution.findMaximumNumber(**test_input) == 1543

test_input = { "k": 1376, "x": 6 }
assert my_solution.findMaximumNumber(**test_input) == 2287

test_input = { "k": 1393, "x": 7 }
assert my_solution.findMaximumNumber(**test_input) == 2800

test_input = { "k": 1415, "x": 4 }
assert my_solution.findMaximumNumber(**test_input) == 1454

test_input = { "k": 1446, "x": 7 }
assert my_solution.findMaximumNumber(**test_input) == 2917

test_input = { "k": 1459, "x": 1 }
assert my_solution.findMaximumNumber(**test_input) == 358

test_input = { "k": 1520, "x": 3 }
assert my_solution.findMaximumNumber(**test_input) == 1017

test_input = { "k": 1539, "x": 6 }
assert my_solution.findMaximumNumber(**test_input) == 2400

test_input = { "k": 1545, "x": 7 }
assert my_solution.findMaximumNumber(**test_input) == 3144

test_input = { "k": 1573, "x": 5 }
assert my_solution.findMaximumNumber(**test_input) == 1732

test_input = { "k": 1588, "x": 8 }
assert my_solution.findMaximumNumber(**test_input) == 3251

test_input = { "k": 1590, "x": 7 }
assert my_solution.findMaximumNumber(**test_input) == 3189

test_input = { "k": 1617, "x": 7 }
assert my_solution.findMaximumNumber(**test_input) == 3280

test_input = { "k": 1633, "x": 6 }
assert my_solution.findMaximumNumber(**test_input) == 2463

test_input = { "k": 1634, "x": 7 }
assert my_solution.findMaximumNumber(**test_input) == 3297

test_input = { "k": 1687, "x": 2 }
assert my_solution.findMaximumNumber(**test_input) == 741

test_input = { "k": 1731, "x": 6 }
assert my_solution.findMaximumNumber(**test_input) == 2528

test_input = { "k": 1750, "x": 5 }
assert my_solution.findMaximumNumber(**test_input) == 1850

test_input = { "k": 1751, "x": 7 }
assert my_solution.findMaximumNumber(**test_input) == 3542

test_input = { "k": 1760, "x": 8 }
assert my_solution.findMaximumNumber(**test_input) == 3551

test_input = { "k": 1782, "x": 8 }
assert my_solution.findMaximumNumber(**test_input) == 3573

test_input = { "k": 1787, "x": 2 }
assert my_solution.findMaximumNumber(**test_input) == 766

test_input = { "k": 1851, "x": 2 }
assert my_solution.findMaximumNumber(**test_input) == 797

test_input = { "k": 1856, "x": 2 }
assert my_solution.findMaximumNumber(**test_input) == 799

test_input = { "k": 1874, "x": 8 }
assert my_solution.findMaximumNumber(**test_input) == 3793

test_input = { "k": 1893, "x": 7 }
assert my_solution.findMaximumNumber(**test_input) == 3812

test_input = { "k": 1900, "x": 1 }
assert my_solution.findMaximumNumber(**test_input) == 444

test_input = { "k": 1900, "x": 7 }
assert my_solution.findMaximumNumber(**test_input) == 3819

test_input = { "k": 1902, "x": 3 }
assert my_solution.findMaximumNumber(**test_input) == 1336


find-beautiful-indices-in-the-given-array-ii

Find Beautiful Indices in the Given Array II

Prompt:
"""
给你一个下标从 0开始的字符串s、字符串a、字符串b和一个整数k。
如果下标 i满足以下条件，则认为它是一个 美丽下标：

0 <= i <= s.length - a.length
s[i..(i + a.length - 1)] == a
存在下标j使得：

0 <= j <= s.length - b.length
s[j..(j + b.length - 1)] == b
|j - i| <= k

以数组形式按从小到大排序返回美丽下标。

示例 1：

输入：s = "isawsquirrelnearmysquirrelhouseohmy", a = "my", b = "squirrel", k = 15
输出：[16,33]
解释：存在 2 个美丽下标：[16,33]。
- 下标 16 是美丽下标，因为 s[16..17] == "my" ，且存在下标 4 ，满足 s[4..11] == "squirrel" 且 |16 - 4| <= 15 。
- 下标 33 是美丽下标，因为 s[33..34] == "my" ，且存在下标 18 ，满足 s[18..25] == "squirrel" 且 |33 - 18| <= 15 。
因此返回 [16,33] 作为结果。
示例 2：

输入：s = "abcd", a = "a", b = "a", k = 4
输出：[0]
解释：存在 1 个美丽下标：[0]。
- 下标 0 是美丽下标，因为 s[0..0] == "a" ，且存在下标 0 ，满足 s[0..0] == "a" 且 |0 - 0| <= 4 。
因此返回 [0] 作为结果。

提示：

1 <= k <= s.length <= 5 * 105
1 <= a.length, b.length <= 5 * 105
s、a、和b只包含小写英文字母。
"""
class Solution:
    def beautifulIndices(self, s: str, a: str, b: str, k: int) -> List[int]:

给你一个下标从 0开始的字符串s、字符串a、字符串b和一个整数k。
如果下标 i满足以下条件，则认为它是一个 美丽下标：

0 <= i <= s.length - a.length
s[i..(i + a.length - 1)] == a
存在下标j使得：

0 <= j <= s.length - b.length
s[j..(j + b.length - 1)] == b
|j - i| <= k

以数组形式按从小到大排序返回美丽下标。

示例 1：

输入：s = "isawsquirrelnearmysquirrelhouseohmy", a = "my", b = "squirrel", k = 15
输出：[16,33]
解释：存在 2 个美丽下标：[16,33]。
- 下标 16 是美丽下标，因为 s[16..17] == "my" ，且存在下标 4 ，满足 s[4..11] == "squirrel" 且 |16 - 4| <= 15 。
- 下标 33 是美丽下标，因为 s[33..34] == "my" ，且存在下标 18 ，满足 s[18..25] == "squirrel" 且 |33 - 18| <= 15 。
因此返回 [16,33] 作为结果。
示例 2：

输入：s = "abcd", a = "a", b = "a", k = 4
输出：[0]
解释：存在 1 个美丽下标：[0]。
- 下标 0 是美丽下标，因为 s[0..0] == "a" ，且存在下标 0 ，满足 s[0..0] == "a" 且 |0 - 0| <= 4 。
因此返回 [0] 作为结果。

提示：

1 <= k <= s.length <= 5 * 105
1 <= a.length, b.length <= 5 * 105
s、a、和b只包含小写英文字母。

请完成下面的代码来解决上述问题:
```python
class Solution:
    def beautifulIndices(self, s: str, a: str, b: str, k: int) -> List[int]:

```

my_solution = Solution()

test_input = { "s": "isawsquirrelnearmysquirrelhouseohmy", "a": "my", "b": "squirrel", "k": 15 }
assert my_solution.beautifulIndices(**test_input) == [16,33]

test_input = { "s": "abcd", "a": "a", "b": "a", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == [0]

test_input = { "s": "a", "a": "a", "b": "a", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == [0]

test_input = { "s": "aba", "a": "a", "b": "a", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == [0,2]

test_input = { "s": "nvnvt", "a": "eq", "b": "nv", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "npearbvede", "a": "myqpb", "b": "pearb", "k": 9 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "vatevavakz", "a": "va", "b": "lbda", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "ithhi", "a": "t", "b": "hhi", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == [1]

test_input = { "s": "osuv", "a": "osuv", "b": "wrn", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "dc", "a": "dreec", "b": "dc", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "jajrfw", "a": "rf", "b": "j", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == [3]

test_input = { "s": "zcvx", "a": "kfdvv", "b": "tru", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "wltmqbxt", "a": "mqbxt", "b": "lt", "k": 7 }
assert my_solution.beautifulIndices(**test_input) == [3]

test_input = { "s": "gggsytwgzg", "a": "sytwg", "b": "g", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == [3]

test_input = { "s": "diive", "a": "viw", "b": "lqqdn", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "ss", "a": "omkdt", "b": "s", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "hfzoxcm", "a": "hfzo", "b": "ipelr", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "xllimtmil", "a": "imt", "b": "iwqx", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "vdyl", "a": "i", "b": "ir", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "ouwpaz", "a": "mxre", "b": "pa", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "vlxgolxgoi", "a": "xf", "b": "lxgo", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "pnb", "a": "cx", "b": "pn", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "owhixi", "a": "hixi", "b": "anlc", "k": 6 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "lrtsi", "a": "lrts", "b": "i", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "tpyq", "a": "sa", "b": "py", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "imxclscgz", "a": "iujc", "b": "mxcls", "k": 7 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "sc", "a": "fc", "b": "th", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "tgs", "a": "ldy", "b": "tgs", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "ssaeqzzvvg", "a": "ssa", "b": "z", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == [0]

test_input = { "s": "zchdy", "a": "zch", "b": "dm", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "youob", "a": "y", "b": "o", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == [0]

test_input = { "s": "snwj", "a": "snwj", "b": "ry", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "rneq", "a": "ynprc", "b": "yts", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "vxqf", "a": "tcnzs", "b": "qf", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "avnzbrpb", "a": "yzfgy", "b": "cfri", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "de", "a": "segs", "b": "bvdhs", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "ulgzs", "a": "eiib", "b": "ulgz", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "tw", "a": "ypf", "b": "svl", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "sotqbvds", "a": "uoj", "b": "s", "k": 6 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "oexy", "a": "e", "b": "a", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "sywgismky", "a": "sywgi", "b": "t", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "onwawarwa", "a": "wa", "b": "r", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == [4,7]

test_input = { "s": "xpuldtpxpu", "a": "vkhl", "b": "xpu", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "dg", "a": "amhb", "b": "aqwcf", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "spro", "a": "spro", "b": "lytwu", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "gfjuakm", "a": "fj", "b": "jytnd", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "so", "a": "kkhvu", "b": "rukp", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "zwedfgnra", "a": "dfgn", "b": "zwe", "k": 9 }
assert my_solution.beautifulIndices(**test_input) == [3]

test_input = { "s": "nipetnupg", "a": "n", "b": "ipet", "k": 7 }
assert my_solution.beautifulIndices(**test_input) == [0,5]

test_input = { "s": "xckrhkrnfe", "a": "xc", "b": "kr", "k": 9 }
assert my_solution.beautifulIndices(**test_input) == [0]

test_input = { "s": "xibrjp", "a": "ibr", "b": "bpfuf", "k": 6 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "cj", "a": "x", "b": "dea", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "xfejay", "a": "xfej", "b": "koc", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "ijkqk", "a": "nzxwn", "b": "vqk", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "dqa", "a": "qj", "b": "norvy", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "vbgvuo", "a": "u", "b": "rewjx", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "uw", "a": "flap", "b": "lowqe", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "xoi", "a": "vefut", "b": "x", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "qzfsogwd", "a": "qzfs", "b": "txsdv", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "yalimlim", "a": "lim", "b": "bwi", "k": 8 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "mjvosrhrip", "a": "jzz", "b": "vo", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "dyswswiz", "a": "tib", "b": "dysws", "k": 7 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "ftyhkld", "a": "tyh", "b": "znru", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "adubkehe", "a": "kdtxl", "b": "dubke", "k": 7 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "svpbvld", "a": "d", "b": "svpbv", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "rmiwdb", "a": "rmiw", "b": "xgwcv", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "arikarikox", "a": "o", "b": "arik", "k": 8 }
assert my_solution.beautifulIndices(**test_input) == [8]

test_input = { "s": "cigzky", "a": "cigz", "b": "tu", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "hjlllm", "a": "l", "b": "h", "k": 6 }
assert my_solution.beautifulIndices(**test_input) == [2,3,4]

test_input = { "s": "xiyebjzdbv", "a": "iqku", "b": "yebjz", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "qrmogc", "a": "g", "b": "rm", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "lagopphhnl", "a": "gopph", "b": "hnl", "k": 8 }
assert my_solution.beautifulIndices(**test_input) == [2]

test_input = { "s": "xkggxk", "a": "xk", "b": "g", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == [0,4]

test_input = { "s": "cdvr", "a": "iemxd", "b": "dt", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "swuaumom", "a": "swuau", "b": "m", "k": 8 }
assert my_solution.beautifulIndices(**test_input) == [0]

test_input = { "s": "qftqft", "a": "o", "b": "qft", "k": 1 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "bc", "a": "ucfx", "b": "lzgx", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "egzttzmtot", "a": "boxwe", "b": "t", "k": 9 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "agbx", "a": "a", "b": "tw", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "fkm", "a": "gu", "b": "fkm", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "lt", "a": "z", "b": "lt", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "qkddvykd", "a": "kd", "b": "tprs", "k": 8 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "vndnqdehvr", "a": "dnqd", "b": "ybboz", "k": 8 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "lpnltfewly", "a": "few", "b": "l", "k": 6 }
assert my_solution.beautifulIndices(**test_input) == [5]

test_input = { "s": "lgioimioim", "a": "imsfs", "b": "ioim", "k": 10 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "jhucel", "a": "iox", "b": "nx", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "vdgtlvls", "a": "lvl", "b": "cu", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "buyryryrjq", "a": "yr", "b": "u", "k": 9 }
assert my_solution.beautifulIndices(**test_input) == [2,4,6]

test_input = { "s": "fwohvc", "a": "agagg", "b": "fwoh", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "tjityoib", "a": "vh", "b": "jityo", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "tssjrbpsck", "a": "ssjr", "b": "sc", "k": 10 }
assert my_solution.beautifulIndices(**test_input) == [1]

test_input = { "s": "aqxv", "a": "t", "b": "x", "k": 4 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "zw", "a": "l", "b": "c", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "cbccekck", "a": "c", "b": "k", "k": 6 }
assert my_solution.beautifulIndices(**test_input) == [0,2,3,6]

test_input = { "s": "angkytf", "a": "ngk", "b": "ytf", "k": 7 }
assert my_solution.beautifulIndices(**test_input) == [1]

test_input = { "s": "oloxjjjqj", "a": "olox", "b": "j", "k": 7 }
assert my_solution.beautifulIndices(**test_input) == [0]

test_input = { "s": "zbriomnn", "a": "omn", "b": "zbr", "k": 6 }
assert my_solution.beautifulIndices(**test_input) == [4]

test_input = { "s": "ydmlx", "a": "tu", "b": "dml", "k": 5 }
assert my_solution.beautifulIndices(**test_input) == []

test_input = { "s": "lnoffflno", "a": "lno", "b": "f", "k": 3 }
assert my_solution.beautifulIndices(**test_input) == [0,6]

test_input = { "s": "hwayzb", "a": "fc", "b": "hway", "k": 2 }
assert my_solution.beautifulIndices(**test_input) == []


maximum-area-of-longest-diagonal-rectangle

Maximum Area of Longest Diagonal Rectangle

Prompt:
"""
给你一个下标从 0 开始的二维整数数组 dimensions。
对于所有下标 i（0 <= i < dimensions.length），dimensions[i][0] 表示矩形  i 的长度，而 dimensions[i][1] 表示矩形  i 的宽度。
返回对角线最 长 的矩形的 面积 。如果存在多个对角线长度相同的矩形，返回面积最 大 的矩形的面积。

示例 1：

输入：dimensions = [[9,3],[8,6]]
输出：48
解释：
下标 = 0，长度 = 9，宽度 = 3。对角线长度 = sqrt(9 * 9 + 3 * 3) = sqrt(90) ≈ 9.487。
下标 = 1，长度 = 8，宽度 = 6。对角线长度 = sqrt(8 * 8 + 6 * 6) = sqrt(100) = 10。
因此，下标为 1 的矩形对角线更长，所以返回面积 = 8 * 6 = 48。

示例 2：

输入：dimensions = [[3,4],[4,3]]
输出：12
解释：两个矩形的对角线长度相同，为 5，所以最大面积 = 12。

提示：

1 <= dimensions.length <= 100
dimensions[i].length == 2
1 <= dimensions[i][0], dimensions[i][1] <= 100
"""
class Solution:
    def areaOfMaxDiagonal(self, dimensions: List[List[int]]) -> int:

给你一个下标从 0 开始的二维整数数组 dimensions。
对于所有下标 i（0 <= i < dimensions.length），dimensions[i][0] 表示矩形  i 的长度，而 dimensions[i][1] 表示矩形  i 的宽度。
返回对角线最 长 的矩形的 面积 。如果存在多个对角线长度相同的矩形，返回面积最 大 的矩形的面积。

示例 1：

输入：dimensions = [[9,3],[8,6]]
输出：48
解释：
下标 = 0，长度 = 9，宽度 = 3。对角线长度 = sqrt(9 * 9 + 3 * 3) = sqrt(90) ≈ 9.487。
下标 = 1，长度 = 8，宽度 = 6。对角线长度 = sqrt(8 * 8 + 6 * 6) = sqrt(100) = 10。
因此，下标为 1 的矩形对角线更长，所以返回面积 = 8 * 6 = 48。

示例 2：

输入：dimensions = [[3,4],[4,3]]
输出：12
解释：两个矩形的对角线长度相同，为 5，所以最大面积 = 12。

提示：

1 <= dimensions.length <= 100
dimensions[i].length == 2
1 <= dimensions[i][0], dimensions[i][1] <= 100

请完成下面的代码来解决上述问题:
```python
class Solution:
    def areaOfMaxDiagonal(self, dimensions: List[List[int]]) -> int:

```

my_solution = Solution()

test_input = { "dimensions": [[9,3],[8,6]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 48

test_input = { "dimensions": [[3,4],[4,3]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 12

test_input = { "dimensions": [[4,10],[4,9],[9,3],[10,8]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 80

test_input = { "dimensions": [[2,6],[5,1],[3,10],[8,4]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 30

test_input = { "dimensions": [[3,7],[2,10],[3,4],[9,9],[5,10]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 81

test_input = { "dimensions": [[10,4]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 40

test_input = { "dimensions": [[9,9],[1,8],[10,5],[2,8],[6,3],[7,1]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 81

test_input = { "dimensions": [[10,3],[5,9],[8,3]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 30

test_input = { "dimensions": [[2,7],[3,2],[3,3],[10,4],[5,3],[8,10],[8,8],[4,7]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 80

test_input = { "dimensions": [[1,10],[3,10],[4,4],[2,6],[6,3],[6,4],[9,1],[6,1],[2,3]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 30

test_input = { "dimensions": [[4,7],[10,10],[3,7],[9,1],[5,7],[3,9],[10,4],[4,8]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 100

test_input = { "dimensions": [[1,1],[6,8],[6,9],[7,2],[6,8],[1,3],[3,1],[1,9]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 54

test_input = { "dimensions": [[6,6],[1,3],[8,10],[10,1],[3,10],[7,7],[10,8]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 80

test_input = { "dimensions": [[6,5],[8,6],[2,10],[8,1],[9,2],[3,5],[3,5]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 20

test_input = { "dimensions": [[5,1],[4,9],[9,1],[5,8],[2,9],[3,2],[10,10],[5,2]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 100

test_input = { "dimensions": [[8,3],[9,10],[7,7],[6,5],[6,9],[9,10],[5,10]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 90

test_input = { "dimensions": [[6,10],[8,6],[10,1],[7,10],[10,10],[9,5]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 100

test_input = { "dimensions": [[9,5],[9,2],[2,2],[8,9],[5,7],[8,10],[3,5]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 80

test_input = { "dimensions": [[3,9],[9,5]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 45

test_input = { "dimensions": [[10,10],[5,5],[3,2],[2,6],[3,1],[10,7],[4,8],[7,9],[9,9],[1,2]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 100

test_input = { "dimensions": [[2,3],[3,5],[2,1]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 15

test_input = { "dimensions": [[4,4],[7,7]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 49

test_input = { "dimensions": [[7,5],[9,6],[9,4],[5,7],[2,6],[10,3],[9,9],[9,4],[8,2]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 81

test_input = { "dimensions": [[5,1],[9,1],[7,1],[7,1],[3,1],[10,7],[9,1],[7,2],[4,6],[3,6]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 70

test_input = { "dimensions": [[8,4],[7,4],[1,5],[7,8],[5,6],[5,2]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 56

test_input = { "dimensions": [[5,10],[3,7],[8,6],[8,6],[5,9],[10,5],[7,8],[1,9],[2,5],[6,6]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 50

test_input = { "dimensions": [[9,4]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 36

test_input = { "dimensions": [[7,6],[2,8],[9,6],[1,10],[5,1]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 54

test_input = { "dimensions": [[4,2],[1,6],[2,1],[4,10],[10,1],[7,5],[8,3]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 40

test_input = { "dimensions": [[1,4]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 4

test_input = { "dimensions": [[9,4],[6,7]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 36

test_input = { "dimensions": [[7,5]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 35

test_input = { "dimensions": [[1,9],[9,7],[8,4],[6,6],[7,8],[4,6],[7,4],[9,9],[9,8],[8,8]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 81

test_input = { "dimensions": [[3,8],[6,3],[5,2],[3,7],[1,3],[9,8],[4,2],[3,8]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 72

test_input = { "dimensions": [[5,4],[2,4],[8,5],[8,4],[1,2],[6,4]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 40

test_input = { "dimensions": [[7,2],[4,6]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 14

test_input = { "dimensions": [[8,10],[5,2],[4,9]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 80

test_input = { "dimensions": [[9,2],[5,6],[4,2]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 18

test_input = { "dimensions": [[3,8],[2,9],[7,7],[1,5],[1,1]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 49

test_input = { "dimensions": [[6,2],[8,2],[6,8],[7,6],[1,2],[6,8],[10,9],[2,8]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 90

test_input = { "dimensions": [[3,8],[4,1],[5,2],[2,6],[4,9],[10,6],[6,10],[3,4],[6,6],[4,3]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 60

test_input = { "dimensions": [[5,5],[3,8],[2,8]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 24

test_input = { "dimensions": [[8,1],[5,8],[3,8]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 40

test_input = { "dimensions": [[2,8],[8,1],[7,10],[5,7],[2,4],[3,10],[2,10],[7,10],[5,6]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 70

test_input = { "dimensions": [[3,10],[1,3],[10,5],[5,9]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 50

test_input = { "dimensions": [[10,6],[4,3]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 60

test_input = { "dimensions": [[7,8],[8,6],[10,10],[6,7],[7,10]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 100

test_input = { "dimensions": [[7,2],[7,3],[4,6],[4,4],[7,8],[2,4]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 56

test_input = { "dimensions": [[4,7],[3,1],[1,10],[4,2],[4,10],[8,8]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 64

test_input = { "dimensions": [[1,8],[4,3],[7,7],[10,6],[5,5],[1,3],[9,1],[8,3],[3,2],[5,8]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 60

test_input = { "dimensions": [[6,7],[1,7],[5,10],[10,1],[8,3]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 50

test_input = { "dimensions": [[3,5],[2,7],[4,4],[4,9],[7,6],[2,4],[5,2]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 36

test_input = { "dimensions": [[8,8],[6,10],[6,6]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 60

test_input = { "dimensions": [[10,2],[3,3],[5,9],[3,7]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 45

test_input = { "dimensions": [[4,3],[4,1],[8,9],[10,1],[2,7],[7,7],[9,3],[8,6],[1,5],[8,3]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 72

test_input = { "dimensions": [[6,8],[2,3],[4,9],[1,1]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 48

test_input = { "dimensions": [[1,6],[2,10],[1,5],[9,3],[9,1],[2,2]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 20

test_input = { "dimensions": [[6,5],[7,10],[1,2],[10,3],[4,2],[4,8],[5,10],[5,9]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 70

test_input = { "dimensions": [[1,2],[1,2],[2,4],[9,9],[3,8],[3,9],[2,3]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 81

test_input = { "dimensions": [[4,4],[6,1],[1,10],[10,7],[10,5]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 70

test_input = { "dimensions": [[3,2],[2,8],[10,9],[9,8],[2,2],[9,1]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 90

test_input = { "dimensions": [[4,10],[9,6],[4,10],[6,7],[2,3],[7,9],[9,2],[1,9]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 63

test_input = { "dimensions": [[7,4],[10,2],[10,8],[4,9],[4,9],[10,3],[5,4],[4,5],[10,6],[3,9]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 80

test_input = { "dimensions": [[2,5],[7,4],[5,3],[2,4],[3,10],[3,5],[4,5],[4,4],[6,5]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 30

test_input = { "dimensions": [[3,2],[7,10],[8,10],[7,4],[6,1]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 80

test_input = { "dimensions": [[3,8],[4,5],[3,8]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 24

test_input = { "dimensions": [[6,8],[9,9],[1,7]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 81

test_input = { "dimensions": [[8,1],[7,5]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 35

test_input = { "dimensions": [[10,6],[5,1],[9,5],[5,7],[5,8],[6,5],[8,3]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 60

test_input = { "dimensions": [[8,6]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 48

test_input = { "dimensions": [[5,2],[5,9],[9,5],[5,5],[8,6]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 45

test_input = { "dimensions": [[7,8],[9,9],[3,5],[8,1],[1,3],[8,2],[8,6]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 81

test_input = { "dimensions": [[3,10],[6,8],[4,5],[8,1],[7,2],[9,8],[3,7],[3,3],[9,10]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 90

test_input = { "dimensions": [[1,1],[8,7],[4,6],[5,2],[5,9]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 56

test_input = { "dimensions": [[6,2],[8,4],[8,6],[2,10],[6,1],[9,8],[10,8],[10,10],[5,9]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 100

test_input = { "dimensions": [[10,2],[9,7],[4,2],[8,6],[9,10],[10,7],[7,5],[5,10],[5,9]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 90

test_input = { "dimensions": [[1,4],[7,2],[2,6],[7,7]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 49

test_input = { "dimensions": [[2,5],[10,10],[4,4]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 100

test_input = { "dimensions": [[2,10],[10,4],[3,9],[6,10],[2,10],[10,1],[4,1]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 60

test_input = { "dimensions": [[3,6],[5,4],[9,5],[6,2],[4,4],[7,2],[6,7]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 45

test_input = { "dimensions": [[1,1],[1,7]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 7

test_input = { "dimensions": [[1,2],[8,8]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 64

test_input = { "dimensions": [[3,7]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 21

test_input = { "dimensions": [[6,7],[1,5],[10,9],[10,2]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 90

test_input = { "dimensions": [[7,8]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 56

test_input = { "dimensions": [[2,6],[10,3],[10,5],[1,9],[5,2],[9,10],[7,2],[7,7],[1,10]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 90

test_input = { "dimensions": [[3,4],[8,2],[9,3],[2,9],[6,5],[10,5],[4,1],[8,7],[3,9]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 50

test_input = { "dimensions": [[7,6],[6,8],[5,7],[1,1],[4,5],[6,10],[9,3],[4,4]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 60

test_input = { "dimensions": [[1,3],[2,4],[4,9],[10,9],[3,9],[7,5],[2,3],[10,7],[2,3],[1,5]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 90

test_input = { "dimensions": [[1,8],[6,10],[4,8],[3,8],[4,3]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 60

test_input = { "dimensions": [[6,5],[3,10],[8,7],[10,10],[2,8],[5,8],[10,8],[9,10],[2,8],[8,9]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 100

test_input = { "dimensions": [[1,6],[8,3],[6,1],[2,10],[2,5],[3,8]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 20

test_input = { "dimensions": [[7,2],[3,8],[10,10],[7,1],[6,8],[6,7],[10,6],[4,6],[5,7],[10,4]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 100

test_input = { "dimensions": [[9,6]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 54

test_input = { "dimensions": [[8,2],[7,6],[1,4],[1,6],[4,8],[10,9],[9,4],[1,5]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 90

test_input = { "dimensions": [[7,3],[2,5],[7,1],[10,7],[7,4],[8,1]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 70

test_input = { "dimensions": [[9,2]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 18

test_input = { "dimensions": [[9,2],[7,2],[2,7]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 18

test_input = { "dimensions": [[2,8],[10,6],[8,10],[9,9]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 80

test_input = { "dimensions": [[3,3]] }
assert my_solution.areaOfMaxDiagonal(**test_input) == 9


minimum-moves-to-capture-the-queen

Minimum Moves to Capture The Queen

Prompt:
"""
现有一个下标从 0 开始的 8 x 8 棋盘，上面有 3 枚棋子。
给你 6 个整数 a 、b 、c 、d 、e 和 f ，其中：

(a, b) 表示白色车的位置。
(c, d) 表示白色象的位置。
(e, f) 表示黑皇后的位置。

假定你只能移动白色棋子，返回捕获黑皇后所需的最少移动次数。
请注意：

车可以向垂直或水平方向移动任意数量的格子，但不能跳过其他棋子。
象可以沿对角线方向移动任意数量的格子，但不能跳过其他棋子。
如果车或象能移向皇后所在的格子，则认为它们可以捕获皇后。
皇后不能移动。

示例 1：

输入：a = 1, b = 1, c = 8, d = 8, e = 2, f = 3
输出：2
解释：将白色车先移动到 (1, 3) ，然后移动到 (2, 3) 来捕获黑皇后，共需移动 2 次。
由于起始时没有任何棋子正在攻击黑皇后，要想捕获黑皇后，移动次数不可能少于 2 次。

示例 2：

输入：a = 5, b = 3, c = 3, d = 4, e = 5, f = 2
输出：1
解释：可以通过以下任一方式移动 1 次捕获黑皇后：
- 将白色车移动到 (5, 2) 。
- 将白色象移动到 (5, 2) 。

提示：

1 <= a, b, c, d, e, f <= 8
两枚棋子不会同时出现在同一个格子上。
"""
class Solution:
    def minMovesToCaptureTheQueen(self, a: int, b: int, c: int, d: int, e: int, f: int) -> int:

现有一个下标从 0 开始的 8 x 8 棋盘，上面有 3 枚棋子。
给你 6 个整数 a 、b 、c 、d 、e 和 f ，其中：

(a, b) 表示白色车的位置。
(c, d) 表示白色象的位置。
(e, f) 表示黑皇后的位置。

假定你只能移动白色棋子，返回捕获黑皇后所需的最少移动次数。
请注意：

车可以向垂直或水平方向移动任意数量的格子，但不能跳过其他棋子。
象可以沿对角线方向移动任意数量的格子，但不能跳过其他棋子。
如果车或象能移向皇后所在的格子，则认为它们可以捕获皇后。
皇后不能移动。

示例 1：

输入：a = 1, b = 1, c = 8, d = 8, e = 2, f = 3
输出：2
解释：将白色车先移动到 (1, 3) ，然后移动到 (2, 3) 来捕获黑皇后，共需移动 2 次。
由于起始时没有任何棋子正在攻击黑皇后，要想捕获黑皇后，移动次数不可能少于 2 次。

示例 2：

输入：a = 5, b = 3, c = 3, d = 4, e = 5, f = 2
输出：1
解释：可以通过以下任一方式移动 1 次捕获黑皇后：
- 将白色车移动到 (5, 2) 。
- 将白色象移动到 (5, 2) 。

提示：

1 <= a, b, c, d, e, f <= 8
两枚棋子不会同时出现在同一个格子上。

请完成下面的代码来解决上述问题:
```python
class Solution:
    def minMovesToCaptureTheQueen(self, a: int, b: int, c: int, d: int, e: int, f: int) -> int:

```

my_solution = Solution()

test_input = { "a": 1, "b": 1, "c": 8, "d": 8, "e": 2, "f": 3 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 5, "b": 3, "c": 3, "d": 4, "e": 5, "f": 2 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 4, "b": 3, "c": 3, "d": 4, "e": 5, "f": 2 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 1, "b": 1, "c": 1, "d": 4, "e": 1, "f": 8 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 4, "b": 3, "c": 3, "d": 4, "e": 2, "f": 5 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 8, "b": 4, "c": 7, "d": 5, "e": 5, "f": 5 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 1, "b": 8, "c": 4, "d": 3, "e": 2, "f": 7 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 1, "b": 6, "c": 3, "d": 3, "e": 5, "f": 6 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 5, "b": 3, "c": 6, "d": 6, "e": 6, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 5, "b": 1, "c": 6, "d": 6, "e": 2, "f": 7 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 8, "b": 4, "c": 8, "d": 8, "e": 7, "f": 7 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 5, "b": 1, "c": 6, "d": 5, "e": 3, "f": 7 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 5, "b": 2, "c": 8, "d": 6, "e": 7, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 1, "b": 1, "c": 8, "d": 2, "e": 4, "f": 1 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 3, "b": 1, "c": 1, "d": 1, "e": 2, "f": 5 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 8, "b": 5, "c": 2, "d": 4, "e": 5, "f": 7 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 8, "b": 1, "c": 5, "d": 8, "e": 1, "f": 7 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 4, "b": 6, "c": 6, "d": 2, "e": 1, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 7, "b": 5, "c": 7, "d": 6, "e": 2, "f": 8 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 8, "b": 6, "c": 3, "d": 2, "e": 6, "f": 8 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 3, "b": 3, "c": 8, "d": 1, "e": 2, "f": 5 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 4, "b": 5, "c": 6, "d": 1, "e": 4, "f": 7 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 7, "b": 2, "c": 2, "d": 8, "e": 7, "f": 3 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 3, "b": 8, "c": 2, "d": 7, "e": 1, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 3, "b": 5, "c": 5, "d": 3, "e": 1, "f": 8 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 2, "b": 2, "c": 7, "d": 4, "e": 3, "f": 1 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 4, "b": 3, "c": 1, "d": 5, "e": 5, "f": 3 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 7, "b": 5, "c": 2, "d": 5, "e": 6, "f": 3 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 1, "b": 7, "c": 8, "d": 1, "e": 3, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 8, "b": 6, "c": 6, "d": 4, "e": 1, "f": 2 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 7, "b": 8, "c": 4, "d": 4, "e": 3, "f": 6 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 8, "b": 4, "c": 7, "d": 7, "e": 4, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 5, "b": 7, "c": 4, "d": 2, "e": 3, "f": 8 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 6, "b": 1, "c": 7, "d": 8, "e": 8, "f": 7 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 3, "b": 7, "c": 7, "d": 6, "e": 7, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 7, "b": 3, "c": 6, "d": 4, "e": 6, "f": 7 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 5, "b": 7, "c": 1, "d": 1, "e": 5, "f": 6 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 6, "b": 8, "c": 5, "d": 8, "e": 5, "f": 3 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 4, "b": 2, "c": 3, "d": 7, "e": 6, "f": 1 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 3, "b": 2, "c": 6, "d": 1, "e": 6, "f": 2 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 5, "b": 4, "c": 6, "d": 7, "e": 1, "f": 8 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 7, "b": 6, "c": 2, "d": 3, "e": 3, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 7, "b": 6, "c": 2, "d": 1, "e": 2, "f": 6 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 5, "b": 8, "c": 6, "d": 5, "e": 6, "f": 1 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 6, "b": 2, "c": 6, "d": 7, "e": 5, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 7, "b": 5, "c": 4, "d": 4, "e": 7, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 6, "b": 1, "c": 4, "d": 4, "e": 2, "f": 2 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 3, "b": 4, "c": 1, "d": 8, "e": 3, "f": 7 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 7, "b": 7, "c": 1, "d": 6, "e": 3, "f": 1 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 6, "b": 8, "c": 2, "d": 2, "e": 3, "f": 5 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 5, "b": 5, "c": 3, "d": 7, "e": 5, "f": 3 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 7, "b": 3, "c": 5, "d": 3, "e": 8, "f": 5 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 7, "b": 4, "c": 1, "d": 4, "e": 7, "f": 8 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 6, "b": 3, "c": 7, "d": 3, "e": 4, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 1, "b": 4, "c": 6, "d": 7, "e": 4, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 4, "b": 5, "c": 6, "d": 8, "e": 2, "f": 1 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 5, "b": 6, "c": 5, "d": 7, "e": 8, "f": 3 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 5, "b": 1, "c": 8, "d": 2, "e": 1, "f": 3 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 1, "b": 2, "c": 8, "d": 3, "e": 2, "f": 2 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 1, "b": 7, "c": 5, "d": 5, "e": 4, "f": 3 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 4, "b": 3, "c": 7, "d": 8, "e": 1, "f": 5 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 8, "b": 7, "c": 6, "d": 8, "e": 6, "f": 1 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 4, "b": 3, "c": 4, "d": 7, "e": 7, "f": 6 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 8, "b": 4, "c": 6, "d": 6, "e": 2, "f": 1 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 8, "b": 2, "c": 6, "d": 4, "e": 1, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 3, "b": 5, "c": 3, "d": 2, "e": 1, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 3, "b": 6, "c": 1, "d": 3, "e": 3, "f": 7 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 1, "b": 1, "c": 7, "d": 6, "e": 4, "f": 3 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 1, "b": 8, "c": 7, "d": 2, "e": 6, "f": 1 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 5, "b": 8, "c": 4, "d": 5, "e": 7, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 8, "b": 3, "c": 8, "d": 8, "e": 5, "f": 3 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 7, "b": 2, "c": 8, "d": 1, "e": 4, "f": 3 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 3, "b": 5, "c": 8, "d": 7, "e": 6, "f": 1 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 5, "b": 5, "c": 2, "d": 2, "e": 1, "f": 1 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 1, "b": 8, "c": 8, "d": 4, "e": 4, "f": 7 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 3, "b": 6, "c": 7, "d": 6, "e": 8, "f": 8 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 5, "b": 6, "c": 3, "d": 7, "e": 3, "f": 6 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 1, "b": 5, "c": 3, "d": 4, "e": 7, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 5, "b": 6, "c": 2, "d": 2, "e": 5, "f": 8 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 7, "b": 3, "c": 2, "d": 6, "e": 3, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 5, "b": 4, "c": 6, "d": 5, "e": 5, "f": 8 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 1, "b": 1, "c": 2, "d": 4, "e": 5, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 4, "b": 5, "c": 5, "d": 4, "e": 2, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 6, "b": 5, "c": 6, "d": 2, "e": 2, "f": 2 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 1, "b": 5, "c": 4, "d": 2, "e": 8, "f": 1 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 1, "b": 1, "c": 2, "d": 5, "e": 8, "f": 1 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 4, "b": 8, "c": 3, "d": 8, "e": 8, "f": 5 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 1, "b": 8, "c": 4, "d": 7, "e": 5, "f": 6 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 5, "b": 5, "c": 3, "d": 6, "e": 8, "f": 8 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 1, "b": 2, "c": 3, "d": 1, "e": 2, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 1, "b": 8, "c": 6, "d": 3, "e": 2, "f": 8 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 6, "b": 1, "c": 8, "d": 8, "e": 7, "f": 3 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 7, "b": 8, "c": 6, "d": 1, "e": 4, "f": 2 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 1, "b": 6, "c": 4, "d": 2, "e": 8, "f": 5 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 1, "b": 4, "c": 2, "d": 5, "e": 5, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 1

test_input = { "a": 4, "b": 4, "c": 3, "d": 2, "e": 6, "f": 7 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 8, "b": 3, "c": 6, "d": 7, "e": 4, "f": 6 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 2, "b": 5, "c": 1, "d": 1, "e": 8, "f": 4 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 7, "b": 8, "c": 1, "d": 4, "e": 5, "f": 1 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2

test_input = { "a": 5, "b": 5, "c": 2, "d": 1, "e": 1, "f": 1 }
assert my_solution.minMovesToCaptureTheQueen(**test_input) == 2


maximum-size-of-a-set-after-removals

Maximum Size of a Set After Removals

Prompt:
"""
给你两个下标从 0 开始的整数数组 nums1 和 nums2 ，它们的长度都是偶数 n 。
你必须从 nums1 中移除 n / 2 个元素，同时从 nums2 中也移除 n / 2 个元素。移除之后，你将 nums1 和 nums2 中剩下的元素插入到集合 s 中。
返回集合 s可能的 最多 包含多少元素。

示例 1：

输入：nums1 = [1,2,1,2], nums2 = [1,1,1,1]
输出：2
解释：从 nums1 和 nums2 中移除两个 1 。移除后，数组变为 nums1 = [2,2] 和 nums2 = [1,1] 。因此，s = {1,2} 。
可以证明，在移除之后，集合 s 最多可以包含 2 个元素。

示例 2：

输入：nums1 = [1,2,3,4,5,6], nums2 = [2,3,2,3,2,3]
输出：5
解释：从 nums1 中移除 2、3 和 6 ，同时从 nums2 中移除两个 3 和一个 2 。移除后，数组变为 nums1 = [1,4,5] 和 nums2 = [2,3,2] 。因此，s = {1,2,3,4,5} 。
可以证明，在移除之后，集合 s 最多可以包含 5 个元素。

示例 3：

输入：nums1 = [1,1,2,2,3,3], nums2 = [4,4,5,5,6,6]
输出：6
解释：从 nums1 中移除 1、2 和 3 ，同时从 nums2 中移除 4、5 和 6 。移除后，数组变为 nums1 = [1,2,3] 和 nums2 = [4,5,6] 。因此，s = {1,2,3,4,5,6} 。
可以证明，在移除之后，集合 s 最多可以包含 6 个元素。

提示：

n == nums1.length == nums2.length
1 <= n <= 2 * 104
n是偶数。
1 <= nums1[i], nums2[i] <= 109
"""
class Solution:
    def maximumSetSize(self, nums1: List[int], nums2: List[int]) -> int:

给你两个下标从 0 开始的整数数组 nums1 和 nums2 ，它们的长度都是偶数 n 。
你必须从 nums1 中移除 n / 2 个元素，同时从 nums2 中也移除 n / 2 个元素。移除之后，你将 nums1 和 nums2 中剩下的元素插入到集合 s 中。
返回集合 s可能的 最多 包含多少元素。

示例 1：

输入：nums1 = [1,2,1,2], nums2 = [1,1,1,1]
输出：2
解释：从 nums1 和 nums2 中移除两个 1 。移除后，数组变为 nums1 = [2,2] 和 nums2 = [1,1] 。因此，s = {1,2} 。
可以证明，在移除之后，集合 s 最多可以包含 2 个元素。

示例 2：

输入：nums1 = [1,2,3,4,5,6], nums2 = [2,3,2,3,2,3]
输出：5
解释：从 nums1 中移除 2、3 和 6 ，同时从 nums2 中移除两个 3 和一个 2 。移除后，数组变为 nums1 = [1,4,5] 和 nums2 = [2,3,2] 。因此，s = {1,2,3,4,5} 。
可以证明，在移除之后，集合 s 最多可以包含 5 个元素。

示例 3：

输入：nums1 = [1,1,2,2,3,3], nums2 = [4,4,5,5,6,6]
输出：6
解释：从 nums1 中移除 1、2 和 3 ，同时从 nums2 中移除 4、5 和 6 。移除后，数组变为 nums1 = [1,2,3] 和 nums2 = [4,5,6] 。因此，s = {1,2,3,4,5,6} 。
可以证明，在移除之后，集合 s 最多可以包含 6 个元素。

提示：

n == nums1.length == nums2.length
1 <= n <= 2 * 104
n是偶数。
1 <= nums1[i], nums2[i] <= 109

请完成下面的代码来解决上述问题:
```python
class Solution:
    def maximumSetSize(self, nums1: List[int], nums2: List[int]) -> int:

```

my_solution = Solution()

test_input = { "nums1": [1,2,1,2], "nums2": [1,1,1,1] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [1,2,3,4,5,6], "nums2": [2,3,2,3,2,3] }
assert my_solution.maximumSetSize(**test_input) == 5

test_input = { "nums1": [1,1,2,2,3,3], "nums2": [4,4,5,5,6,6] }
assert my_solution.maximumSetSize(**test_input) == 6

test_input = { "nums1": [1,2,1,1], "nums2": [1,2,3,4] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [1,1,1,1], "nums2": [12,23,41,9] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [12,23,41,9], "nums2": [1,1,1,1] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [9,8,4,7], "nums2": [5,5,9,5] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [8,9], "nums2": [4,3] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [7,1], "nums2": [6,10] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [10,3], "nums2": [5,6] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [3,6], "nums2": [6,6] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [5,1], "nums2": [6,6] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [10,7], "nums2": [8,4] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [10,8,7,9], "nums2": [7,9,9,5] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [1,10,6,5], "nums2": [3,7,10,10] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [5,2,8,6], "nums2": [7,4,1,1] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [2,4,1,4], "nums2": [10,2,4,10] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [5,7], "nums2": [3,1] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [1,10,1,2], "nums2": [9,5,8,5] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [9,4], "nums2": [5,7] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [1,5,10,8], "nums2": [1,7,4,10] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [6,6,2,9], "nums2": [1,4,10,7] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [7,10], "nums2": [6,10] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [8,8], "nums2": [6,3] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [6,8], "nums2": [9,3] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [3,8,1,9], "nums2": [2,5,4,5] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [6,1,4,7], "nums2": [10,7,2,2] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [8,7,9,3], "nums2": [10,3,8,2] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [1,4,5,9], "nums2": [2,5,2,7] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [3,5], "nums2": [5,3] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [1,10,8,2], "nums2": [2,9,10,7] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [3,9], "nums2": [1,4] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [1,5], "nums2": [10,5] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [7,5], "nums2": [2,10] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [6,10], "nums2": [3,1] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [9,8,1,3], "nums2": [4,9,8,6] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [4,1], "nums2": [9,9] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [10,7], "nums2": [10,8] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [4,4,3,9], "nums2": [6,8,4,7] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [4,10,4,9], "nums2": [5,7,4,2] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [8,6], "nums2": [1,7] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [9,8,10,7], "nums2": [3,7,7,6] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [4,10,9,10], "nums2": [9,7,3,6] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [6,7], "nums2": [5,7] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [1,1,10,5], "nums2": [6,6,8,5] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [5,3,4,2], "nums2": [10,3,7,10] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [1,3], "nums2": [9,2] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [6,1,6,2], "nums2": [5,4,6,7] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [9,9], "nums2": [8,7] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [6,2,9,3], "nums2": [10,3,4,7] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [6,2,10,1], "nums2": [9,2,6,5] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [6,5,6,1], "nums2": [6,2,6,9] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [10,5,4,7], "nums2": [5,4,4,9] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [7,10,4,6], "nums2": [1,4,4,2] }
assert my_solution.maximumSetSize(**test_input) == 4

test_input = { "nums1": [3,4], "nums2": [1,8] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [7,7], "nums2": [7,1] }
assert my_solution.maximumSetSize(**test_input) == 2

test_input = { "nums1": [1,1,2,2,1,1], "nums2": [1,3,2,2,2,1] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [3,3,3,2,1,2,1,2], "nums2": [1,2,3,2,2,3,3,1] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [1,3,3,2], "nums2": [2,2,1,3] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [1,1,1,3,3,3,1,1], "nums2": [3,2,3,2,3,3,3,3] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [3,3,1,1,3,2], "nums2": [2,2,1,1,2,2] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [2,3,2,3,3,1], "nums2": [2,3,1,2,1,1] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [1,1,3,3,1,3,3,3], "nums2": [2,3,1,3,1,1,1,3] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [2,3,2,2,1,3,1,1], "nums2": [3,1,2,2,3,1,2,2] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [2,2,2,3,1,1,3,3], "nums2": [3,1,3,1,2,3,2,2] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [3,3,1,3,2,2,3,1], "nums2": [3,1,2,3,1,3,2,1] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [1,1,1,2,1,1,1,1,1,2], "nums2": [3,1,3,3,1,1,3,2,1,3] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [3,2,2,3], "nums2": [1,1,1,3] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [2,3,3,1,2,1,2,2], "nums2": [1,2,2,1,2,1,2,2] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [1,2,1,3,2,3], "nums2": [3,3,1,1,3,3] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [1,3,1,3,3,3,3,2,2,2], "nums2": [2,1,3,2,2,3,3,1,1,3] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [1,3,1,1,2,2,1,1], "nums2": [2,3,3,1,3,2,3,2] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [2,3,2,2,2,2,1,2], "nums2": [3,1,2,3,3,1,2,1] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [3,3,2,1,2,3], "nums2": [2,1,1,3,2,2] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [1,3,1,2,1,1,2,3], "nums2": [1,2,2,3,2,3,3,3] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [1,1,1,3,1,2,1,1], "nums2": [2,3,3,2,3,3,1,1] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [3,1,3,3,2,2,2,3,1,1], "nums2": [1,1,2,1,3,3,1,3,2,1] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [1,1,1,2,3,2,1,1], "nums2": [2,1,2,2,2,1,3,3] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [2,1,3,2,2,2,2,2], "nums2": [1,3,3,2,2,2,3,1] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [1,3,1,1], "nums2": [1,3,1,2] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [1,3,3,1,3,2], "nums2": [2,1,3,2,2,2] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [3,2,3,3,2,2], "nums2": [1,3,1,3,1,1] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [1,3,1,3,2,3], "nums2": [2,1,1,1,2,3] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [1,1,3,1,3,1], "nums2": [3,3,1,2,2,1] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [2,2,2,2,2,3,1,3], "nums2": [2,3,3,2,1,2,3,1] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [1,3,1,2,3,1], "nums2": [3,3,2,2,1,3] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [2,1,2,2,1,3], "nums2": [1,1,1,3,2,3] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [2,2,1,2,1,3,3,1], "nums2": [3,1,3,1,1,3,3,1] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [3,1,3,3,2,3], "nums2": [1,3,3,2,2,1] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [3,2,1,3,3,2], "nums2": [1,1,3,3,1,2] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [2,1,3,2,3,3], "nums2": [2,2,2,3,2,1] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [3,3,3,1,2,2,3,1], "nums2": [3,1,2,3,2,3,2,1] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [3,1,3,1,2,1,2,2,2,2], "nums2": [2,1,3,1,1,1,2,2,1,3] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [1,2,2,1,3,3], "nums2": [1,1,1,3,2,2] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [2,1,2,3], "nums2": [3,2,3,2] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [3,1,2,2], "nums2": [2,1,1,1] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [2,2,3,2], "nums2": [2,1,3,3] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [3,3,2,1,3,3,2,3], "nums2": [3,1,2,3,2,2,1,3] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [3,3,3,1,2,2], "nums2": [1,3,1,2,2,3] }
assert my_solution.maximumSetSize(**test_input) == 3

test_input = { "nums1": [3,1,1,3,1,1,3,2], "nums2": [3,2,3,3,3,1,2,3] }
assert my_solution.maximumSetSize(**test_input) == 3