find-maximum-non-decreasing-array-length

Find Maximum Non-decreasing Array Length

Prompt:
"""
You are given a 0-indexed integer array nums.
You can perform any number of operations, where each operation involves selecting a subarray of the array and replacing it with the sum of its elements. For example, if the given array is [1,3,5,6] and you select subarray [3,5] the array will convert to [1,8,6].
Return the maximum length of a non-decreasing array that can be made after applying operations.
A subarray is a contiguous non-empty sequence of elements within an array.

Example 1:

Input: nums = [5,2,2]
Output: 1
Explanation: This array with length 3 is not non-decreasing.
We have two ways to make the array length two.
First, choosing subarray [2,2] converts the array to [5,4].
Second, choosing subarray [5,2] converts the array to [7,2].
In these two ways the array is not non-decreasing.
And if we choose subarray [5,2,2] and replace it with [9] it becomes non-decreasing.
So the answer is 1.

Example 2:

Input: nums = [1,2,3,4]
Output: 4
Explanation: The array is non-decreasing. So the answer is 4.

Example 3:

Input: nums = [4,3,2,6]
Output: 3
Explanation: Replacing [3,2] with [5] converts the given array to [4,5,6] that is non-decreasing.
Because the given array is not non-decreasing, the maximum possible answer is 3.

Constraints:

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

You are given a 0-indexed integer array nums.
You can perform any number of operations, where each operation involves selecting a subarray of the array and replacing it with the sum of its elements. For example, if the given array is [1,3,5,6] and you select subarray [3,5] the array will convert to [1,8,6].
Return the maximum length of a non-decreasing array that can be made after applying operations.
A subarray is a contiguous non-empty sequence of elements within an array.

Example 1:

Input: nums = [5,2,2]
Output: 1
Explanation: This array with length 3 is not non-decreasing.
We have two ways to make the array length two.
First, choosing subarray [2,2] converts the array to [5,4].
Second, choosing subarray [5,2] converts the array to [7,2].
In these two ways the array is not non-decreasing.
And if we choose subarray [5,2,2] and replace it with [9] it becomes non-decreasing.
So the answer is 1.

Example 2:

Input: nums = [1,2,3,4]
Output: 4
Explanation: The array is non-decreasing. So the answer is 4.

Example 3:

Input: nums = [4,3,2,6]
Output: 3
Explanation: Replacing [3,2] with [5] converts the given array to [4,5,6] that is non-decreasing.
Because the given array is not non-decreasing, the maximum possible answer is 3.

Constraints:

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

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

```

my_solution = Solution()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

test_input = { "nums": [29,859] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [48,612] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [76,837] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [103,341] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [171,323] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [248,719] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [253,61] }
assert my_solution.findMaximumLength(**test_input) == 1

test_input = { "nums": [274,467] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [351,665] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [372,382] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [404,409] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [455,40] }
assert my_solution.findMaximumLength(**test_input) == 1

test_input = { "nums": [472,843] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [504,838] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [549,747] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [570,810] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [621,809] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [643,802] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [689,192] }
assert my_solution.findMaximumLength(**test_input) == 1

test_input = { "nums": [709,481] }
assert my_solution.findMaximumLength(**test_input) == 1

test_input = { "nums": [742,67] }
assert my_solution.findMaximumLength(**test_input) == 1

test_input = { "nums": [745,725] }
assert my_solution.findMaximumLength(**test_input) == 1

test_input = { "nums": [773,877] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [776,962] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [791,434] }
assert my_solution.findMaximumLength(**test_input) == 1

test_input = { "nums": [824,783] }
assert my_solution.findMaximumLength(**test_input) == 1

test_input = { "nums": [840,388] }
assert my_solution.findMaximumLength(**test_input) == 1

test_input = { "nums": [876,264] }
assert my_solution.findMaximumLength(**test_input) == 1

test_input = { "nums": [940,694] }
assert my_solution.findMaximumLength(**test_input) == 1

test_input = { "nums": [959,372] }
assert my_solution.findMaximumLength(**test_input) == 1

test_input = { "nums": [981,998] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [41,340,784] }
assert my_solution.findMaximumLength(**test_input) == 3

test_input = { "nums": [103,652,579] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [116,635,966] }
assert my_solution.findMaximumLength(**test_input) == 3

test_input = { "nums": [137,32,745] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [247,173,316] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [276,315,947] }
assert my_solution.findMaximumLength(**test_input) == 3

test_input = { "nums": [278,754,912] }
assert my_solution.findMaximumLength(**test_input) == 3

test_input = { "nums": [314,882,708] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [371,101,367] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [402,305,990] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [403,553,697] }
assert my_solution.findMaximumLength(**test_input) == 3

test_input = { "nums": [431,780,315] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [479,322,44] }
assert my_solution.findMaximumLength(**test_input) == 1

test_input = { "nums": [512,234,679] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [513,847,778] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [525,177,936] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [588,42,18] }
assert my_solution.findMaximumLength(**test_input) == 1

test_input = { "nums": [646,174,827] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [680,242,726] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [769,131,241] }
assert my_solution.findMaximumLength(**test_input) == 1

test_input = { "nums": [780,591,213] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [783,23,848] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [787,201,30] }
assert my_solution.findMaximumLength(**test_input) == 1

test_input = { "nums": [791,470,87] }
assert my_solution.findMaximumLength(**test_input) == 1

test_input = { "nums": [797,181,492] }
assert my_solution.findMaximumLength(**test_input) == 1

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

test_input = { "nums": [881,306,316] }
assert my_solution.findMaximumLength(**test_input) == 1

test_input = { "nums": [886,116,68] }
assert my_solution.findMaximumLength(**test_input) == 1

test_input = { "nums": [893,531,805] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [926,641,145] }
assert my_solution.findMaximumLength(**test_input) == 1

test_input = { "nums": [964,624,279] }
assert my_solution.findMaximumLength(**test_input) == 1

test_input = { "nums": [987,694,396] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [38,986,134,156] }
assert my_solution.findMaximumLength(**test_input) == 2

test_input = { "nums": [43,236,417,521] }
assert my_solution.findMaximumLength(**test_input) == 4

test_input = { "nums": [58,890,892,52] }
assert my_solution.findMaximumLength(**test_input) == 3

test_input = { "nums": [81,738,403,654] }
assert my_solution.findMaximumLength(**test_input) == 3


make-three-strings-equal

Make Three Strings Equal

Prompt:
"""
You are given three strings s1, s2, and s3. You have to perform the following operation on these three strings as many times as you want.
In one operation you can choose one of these three strings such that its length is at least 2 and delete the rightmost character of it.
Return the minimum number of operations you need to perform to make the three strings equal if there is a way to make them equal, otherwise, return -1.

Example 1:

Input: s1 = "abc", s2 = "abb", s3 = "ab"
Output: 2
Explanation: Performing operations on s1 and s2 once will lead to three equal strings.
It can be shown that there is no way to make them equal with less than two operations.
Example 2:

Input: s1 = "dac", s2 = "bac", s3 = "cac"
Output: -1
Explanation: Because the leftmost letters of s1 and s2 are not equal, they could not be equal after any number of operations. So the answer is -1.

Constraints:

1 <= s1.length, s2.length, s3.length <= 100
s1, s2 and s3 consist only of lowercase English letters.
"""
class Solution:
    def findMinimumOperations(self, s1: str, s2: str, s3: str) -> int:

You are given three strings s1, s2, and s3. You have to perform the following operation on these three strings as many times as you want.
In one operation you can choose one of these three strings such that its length is at least 2 and delete the rightmost character of it.
Return the minimum number of operations you need to perform to make the three strings equal if there is a way to make them equal, otherwise, return -1.

Example 1:

Input: s1 = "abc", s2 = "abb", s3 = "ab"
Output: 2
Explanation: Performing operations on s1 and s2 once will lead to three equal strings.
It can be shown that there is no way to make them equal with less than two operations.
Example 2:

Input: s1 = "dac", s2 = "bac", s3 = "cac"
Output: -1
Explanation: Because the leftmost letters of s1 and s2 are not equal, they could not be equal after any number of operations. So the answer is -1.

Constraints:

1 <= s1.length, s2.length, s3.length <= 100
s1, s2 and s3 consist only of lowercase English letters.

Please complete the code below to solve above prblem:
```python
class Solution:
    def findMinimumOperations(self, s1: str, s2: str, s3: str) -> int:

```

my_solution = Solution()

test_input = { "s1": "abc", "s2": "abb", "s3": "ab" }
assert my_solution.findMinimumOperations(**test_input) == 2

test_input = { "s1": "dac", "s2": "bac", "s3": "cac" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "a", "s2": "a", "s3": "a" }
assert my_solution.findMinimumOperations(**test_input) == 0

test_input = { "s1": "kui", "s2": "m", "s3": "v" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "a", "s2": "aabc", "s3": "a" }
assert my_solution.findMinimumOperations(**test_input) == 3

test_input = { "s1": "cc", "s2": "cccb", "s3": "c" }
assert my_solution.findMinimumOperations(**test_input) == 4

test_input = { "s1": "luso", "s2": "lu", "s3": "lu" }
assert my_solution.findMinimumOperations(**test_input) == 2

test_input = { "s1": "xx", "s2": "phe", "s3": "xie" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "gzd", "s2": "bcju", "s3": "db" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "cbba", "s2": "cbaa", "s3": "c" }
assert my_solution.findMinimumOperations(**test_input) == 6

test_input = { "s1": "k", "s2": "kfb", "s3": "krcnf" }
assert my_solution.findMinimumOperations(**test_input) == 6

test_input = { "s1": "oby", "s2": "obz", "s3": "obf" }
assert my_solution.findMinimumOperations(**test_input) == 3

test_input = { "s1": "b", "s2": "aba", "s3": "aaccaa" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "a", "s2": "accabb", "s3": "aaa" }
assert my_solution.findMinimumOperations(**test_input) == 7

test_input = { "s1": "b", "s2": "bccaaba", "s3": "ba" }
assert my_solution.findMinimumOperations(**test_input) == 7

test_input = { "s1": "b", "s2": "bacccab", "s3": "cc" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "ca", "s2": "cccabb", "s3": "cb" }
assert my_solution.findMinimumOperations(**test_input) == 7

test_input = { "s1": "ccb", "s2": "ccba", "s3": "ccb" }
assert my_solution.findMinimumOperations(**test_input) == 1

test_input = { "s1": "mbooi", "s2": "pdq", "s3": "br" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "xxfzj", "s2": "faho", "s3": "c" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "acbc", "s2": "acba", "s3": "acb" }
assert my_solution.findMinimumOperations(**test_input) == 2

test_input = { "s1": "aduyyk", "s2": "v", "s3": "lpyt" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "xd", "s2": "sl", "s3": "azoeaje" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "bbbaa", "s2": "bacab", "s3": "b" }
assert my_solution.findMinimumOperations(**test_input) == 8

test_input = { "s1": "cibn", "s2": "ioom", "s3": "bxa" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "bcb", "s2": "bbac", "s3": "cbbc" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "aabbb", "s2": "cc", "s3": "cccb" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "i", "s2": "xqsfy", "s3": "diqae" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "iq", "s2": "iimanmy", "s3": "id" }
assert my_solution.findMinimumOperations(**test_input) == 8

test_input = { "s1": "pitggt", "s2": "pi", "s3": "pih" }
assert my_solution.findMinimumOperations(**test_input) == 5

test_input = { "s1": "ten", "s2": "ten", "s3": "tenob" }
assert my_solution.findMinimumOperations(**test_input) == 2

test_input = { "s1": "vejy", "s2": "fbqfo", "s3": "gl" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "aca", "s2": "abcc", "s3": "accba" }
assert my_solution.findMinimumOperations(**test_input) == 9

test_input = { "s1": "br", "s2": "br", "s3": "brvhgtou" }
assert my_solution.findMinimumOperations(**test_input) == 6

test_input = { "s1": "c", "s2": "bcc", "s3": "aacbcaca" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "cab", "s2": "caac", "s3": "cacbb" }
assert my_solution.findMinimumOperations(**test_input) == 6

test_input = { "s1": "ccab", "s2": "cbbcbb", "s3": "ca" }
assert my_solution.findMinimumOperations(**test_input) == 9

test_input = { "s1": "inuc", "s2": "iwpdfj", "s3": "ib" }
assert my_solution.findMinimumOperations(**test_input) == 9

test_input = { "s1": "jrrpyyc", "s2": "jr", "s3": "jrt" }
assert my_solution.findMinimumOperations(**test_input) == 6

test_input = { "s1": "l", "s2": "gebqrgnz", "s3": "jkr" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "naynn", "s2": "ax", "s3": "bhdcz" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "rexmx", "s2": "ujmbg", "s3": "gg" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "aacbcb", "s2": "a", "s3": "acaaac" }
assert my_solution.findMinimumOperations(**test_input) == 10

test_input = { "s1": "acbb", "s2": "acbacc", "s3": "acb" }
assert my_solution.findMinimumOperations(**test_input) == 4

test_input = { "s1": "baacbab", "s2": "bcc", "s3": "bca" }
assert my_solution.findMinimumOperations(**test_input) == 10

test_input = { "s1": "bcacbba", "s2": "bca", "s3": "bca" }
assert my_solution.findMinimumOperations(**test_input) == 4

test_input = { "s1": "bcaca", "s2": "bcaba", "s3": "bca" }
assert my_solution.findMinimumOperations(**test_input) == 4

test_input = { "s1": "ba", "s2": "bcbcab", "s3": "bbcbb" }
assert my_solution.findMinimumOperations(**test_input) == 10

test_input = { "s1": "cabc", "s2": "cab", "s3": "cabbac" }
assert my_solution.findMinimumOperations(**test_input) == 4

test_input = { "s1": "bbbbcaac", "s2": "a", "s3": "cbcc" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "gjbtodtym", "s2": "gxp", "s3": "g" }
assert my_solution.findMinimumOperations(**test_input) == 10

test_input = { "s1": "hfkq", "s2": "hfrbvno", "s3": "hf" }
assert my_solution.findMinimumOperations(**test_input) == 7

test_input = { "s1": "hym", "s2": "hl", "s3": "hshxmbbj" }
assert my_solution.findMinimumOperations(**test_input) == 10

test_input = { "s1": "mkdflu", "s2": "mmbn", "s3": "mge" }
assert my_solution.findMinimumOperations(**test_input) == 10

test_input = { "s1": "nvlobl", "s2": "mekbzd", "s3": "s" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "rpa", "s2": "rpaxpoh", "s3": "rpa" }
assert my_solution.findMinimumOperations(**test_input) == 4

test_input = { "s1": "ac", "s2": "aacccccbc", "s3": "acc" }
assert my_solution.findMinimumOperations(**test_input) == 11

test_input = { "s1": "abb", "s2": "abaac", "s3": "abcaca" }
assert my_solution.findMinimumOperations(**test_input) == 8

test_input = { "s1": "caa", "s2": "caccaccacb", "s3": "c" }
assert my_solution.findMinimumOperations(**test_input) == 11

test_input = { "s1": "baccaab", "s2": "cababc", "s3": "a" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "cacbb", "s2": "ca", "s3": "cacbcac" }
assert my_solution.findMinimumOperations(**test_input) == 8

test_input = { "s1": "cbba", "s2": "cabcabab", "s3": "ca" }
assert my_solution.findMinimumOperations(**test_input) == 11

test_input = { "s1": "cb", "s2": "cbcbb", "s3": "cbaaabb" }
assert my_solution.findMinimumOperations(**test_input) == 8

test_input = { "s1": "ccabaa", "s2": "ccabc", "s3": "cca" }
assert my_solution.findMinimumOperations(**test_input) == 5

test_input = { "s1": "ccb", "s2": "ccac", "s3": "cccaaca" }
assert my_solution.findMinimumOperations(**test_input) == 8

test_input = { "s1": "ccccbb", "s2": "cccc", "s3": "cccc" }
assert my_solution.findMinimumOperations(**test_input) == 2

test_input = { "s1": "cxxq", "s2": "cxx", "s3": "cxxdeqh" }
assert my_solution.findMinimumOperations(**test_input) == 5

test_input = { "s1": "d", "s2": "dffjiulzya", "s3": "dke" }
assert my_solution.findMinimumOperations(**test_input) == 11

test_input = { "s1": "dogv", "s2": "dofjkhx", "s3": "dog" }
assert my_solution.findMinimumOperations(**test_input) == 8

test_input = { "s1": "dwefrocz", "s2": "dzz", "s3": "dwn" }
assert my_solution.findMinimumOperations(**test_input) == 11

test_input = { "s1": "etr", "s2": "ejb", "s3": "etpubpvr" }
assert my_solution.findMinimumOperations(**test_input) == 11

test_input = { "s1": "f", "s2": "morycy", "s3": "vledqoo" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "ful", "s2": "fular", "s3": "fulvkv" }
assert my_solution.findMinimumOperations(**test_input) == 5

test_input = { "s1": "kzwat", "s2": "ku", "s3": "koftvbd" }
assert my_solution.findMinimumOperations(**test_input) == 11

test_input = { "s1": "qey", "s2": "qevtkbss", "s3": "qeb" }
assert my_solution.findMinimumOperations(**test_input) == 8

test_input = { "s1": "saqy", "s2": "hvufcpko", "s3": "xm" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "tllwgcdi", "s2": "t", "s3": "tvham" }
assert my_solution.findMinimumOperations(**test_input) == 11

test_input = { "s1": "vmwdmadn", "s2": "vmw", "s3": "vmw" }
assert my_solution.findMinimumOperations(**test_input) == 5

test_input = { "s1": "xobwwhu", "s2": "xobb", "s3": "xob" }
assert my_solution.findMinimumOperations(**test_input) == 5

test_input = { "s1": "yptajimiz", "s2": "yp", "s3": "ypr" }
assert my_solution.findMinimumOperations(**test_input) == 8

test_input = { "s1": "z", "s2": "zcrouxlukb", "s3": "zbb" }
assert my_solution.findMinimumOperations(**test_input) == 11

test_input = { "s1": "aaabc", "s2": "aaaa", "s3": "aaaabc" }
assert my_solution.findMinimumOperations(**test_input) == 6

test_input = { "s1": "aaa", "s2": "aab", "s3": "aabaacaab" }
assert my_solution.findMinimumOperations(**test_input) == 9

test_input = { "s1": "aac", "s2": "aac", "s3": "aacabbbca" }
assert my_solution.findMinimumOperations(**test_input) == 6

test_input = { "s1": "abaab", "s2": "abaabb", "s3": "abaa" }
assert my_solution.findMinimumOperations(**test_input) == 3

test_input = { "s1": "abcomon", "s2": "gkuneup", "s3": "q" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "acc", "s2": "accacb", "s3": "acbabc" }
assert my_solution.findMinimumOperations(**test_input) == 9

test_input = { "s1": "cca", "s2": "caaab", "s3": "babbacc" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "bccbc", "s2": "bc", "s3": "bcccbcac" }
assert my_solution.findMinimumOperations(**test_input) == 9

test_input = { "s1": "bpp", "s2": "bin", "s3": "bfkbyhubw" }
assert my_solution.findMinimumOperations(**test_input) == 12

test_input = { "s1": "bbsyg", "s2": "blbp", "s3": "brghkr" }
assert my_solution.findMinimumOperations(**test_input) == 12

test_input = { "s1": "bxpvamp", "s2": "bxpv", "s3": "bxpv" }
assert my_solution.findMinimumOperations(**test_input) == 3

test_input = { "s1": "ccbabca", "s2": "cbcbaca", "s3": "c" }
assert my_solution.findMinimumOperations(**test_input) == 12

test_input = { "s1": "accb", "s2": "bbc", "s3": "cbbaccba" }
assert my_solution.findMinimumOperations(**test_input) == -1

test_input = { "s1": "cbccc", "s2": "cbc", "s3": "cbcccba" }
assert my_solution.findMinimumOperations(**test_input) == 6

test_input = { "s1": "cac", "s2": "ccacc", "s3": "cabacba" }
assert my_solution.findMinimumOperations(**test_input) == 12

test_input = { "s1": "ccb", "s2": "ccbcb", "s3": "ccbccab" }
assert my_solution.findMinimumOperations(**test_input) == 6

test_input = { "s1": "caacabcbc", "s2": "ccb", "s3": "ccc" }
assert my_solution.findMinimumOperations(**test_input) == 12

test_input = { "s1": "cccabaacc", "s2": "ccc", "s3": "ccc" }
assert my_solution.findMinimumOperations(**test_input) == 6

test_input = { "s1": "ajjdre", "s2": "gsrq", "s3": "eurcj" }
assert my_solution.findMinimumOperations(**test_input) == -1


separate-black-and-white-balls

Separate Black and White Balls

Prompt:
"""
There are n balls on a table, each ball has a color black or white.
You are given a 0-indexed binary string s of length n, where 1 and 0 represent black and white balls, respectively.
In each step, you can choose two adjacent balls and swap them.
Return the minimum number of steps to group all the black balls to the right and all the white balls to the left.

Example 1:

Input: s = "101"
Output: 1
Explanation: We can group all the black balls to the right in the following way:
- Swap s[0] and s[1], s = "011".
Initially, 1s are not grouped together, requiring at least 1 step to group them to the right.
Example 2:

Input: s = "100"
Output: 2
Explanation: We can group all the black balls to the right in the following way:
- Swap s[0] and s[1], s = "010".
- Swap s[1] and s[2], s = "001".
It can be proven that the minimum number of steps needed is 2.

Example 3:

Input: s = "0111"
Output: 0
Explanation: All the black balls are already grouped to the right.

Constraints:

1 <= n == s.length <= 105
s[i] is either '0' or '1'.
"""
class Solution:
    def minimumSteps(self, s: str) -> int:

There are n balls on a table, each ball has a color black or white.
You are given a 0-indexed binary string s of length n, where 1 and 0 represent black and white balls, respectively.
In each step, you can choose two adjacent balls and swap them.
Return the minimum number of steps to group all the black balls to the right and all the white balls to the left.

Example 1:

Input: s = "101"
Output: 1
Explanation: We can group all the black balls to the right in the following way:
- Swap s[0] and s[1], s = "011".
Initially, 1s are not grouped together, requiring at least 1 step to group them to the right.
Example 2:

Input: s = "100"
Output: 2
Explanation: We can group all the black balls to the right in the following way:
- Swap s[0] and s[1], s = "010".
- Swap s[1] and s[2], s = "001".
It can be proven that the minimum number of steps needed is 2.

Example 3:

Input: s = "0111"
Output: 0
Explanation: All the black balls are already grouped to the right.

Constraints:

1 <= n == s.length <= 105
s[i] is either '0' or '1'.

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

```

my_solution = Solution()

test_input = { "s": "101" }
assert my_solution.minimumSteps(**test_input) == 1

test_input = { "s": "100" }
assert my_solution.minimumSteps(**test_input) == 2

test_input = { "s": "0111" }
assert my_solution.minimumSteps(**test_input) == 0

test_input = { "s": "11000111" }
assert my_solution.minimumSteps(**test_input) == 6

test_input = { "s": "01010001" }
assert my_solution.minimumSteps(**test_input) == 7

test_input = { "s": "0100101" }
assert my_solution.minimumSteps(**test_input) == 4

test_input = { "s": "111111111100100010" }
assert my_solution.minimumSteps(**test_input) == 65

test_input = { "s": "10100000110010011010" }
assert my_solution.minimumSteps(**test_input) == 44

test_input = { "s": "1101110000111011110" }
assert my_solution.minimumSteps(**test_input) == 42

test_input = { "s": "01000010111010001" }
assert my_solution.minimumSteps(**test_input) == 29

test_input = { "s": "11110" }
assert my_solution.minimumSteps(**test_input) == 4

test_input = { "s": "010001001011010" }
assert my_solution.minimumSteps(**test_input) == 21

test_input = { "s": "0011011" }
assert my_solution.minimumSteps(**test_input) == 2

test_input = { "s": "001" }
assert my_solution.minimumSteps(**test_input) == 0

test_input = { "s": "000100100" }
assert my_solution.minimumSteps(**test_input) == 6

test_input = { "s": "00110" }
assert my_solution.minimumSteps(**test_input) == 2

test_input = { "s": "001110001110001" }
assert my_solution.minimumSteps(**test_input) == 27

test_input = { "s": "10000000001" }
assert my_solution.minimumSteps(**test_input) == 9

test_input = { "s": "01" }
assert my_solution.minimumSteps(**test_input) == 0

test_input = { "s": "0100011100001100100" }
assert my_solution.minimumSteps(**test_input) == 45

test_input = { "s": "1010110" }
assert my_solution.minimumSteps(**test_input) == 7

test_input = { "s": "010010000" }
assert my_solution.minimumSteps(**test_input) == 10

test_input = { "s": "100110" }
assert my_solution.minimumSteps(**test_input) == 5

test_input = { "s": "1100" }
assert my_solution.minimumSteps(**test_input) == 4

test_input = { "s": "000110" }
assert my_solution.minimumSteps(**test_input) == 2

test_input = { "s": "001101101111000000" }
assert my_solution.minimumSteps(**test_input) == 54

test_input = { "s": "011101011" }
assert my_solution.minimumSteps(**test_input) == 7

test_input = { "s": "0110111111110" }
assert my_solution.minimumSteps(**test_input) == 12

test_input = { "s": "1111001111111011111" }
assert my_solution.minimumSteps(**test_input) == 19

test_input = { "s": "0101111" }
assert my_solution.minimumSteps(**test_input) == 1

test_input = { "s": "00010101100110011" }
assert my_solution.minimumSteps(**test_input) == 23

test_input = { "s": "01010110110111011001" }
assert my_solution.minimumSteps(**test_input) == 44

test_input = { "s": "0" }
assert my_solution.minimumSteps(**test_input) == 0

test_input = { "s": "1101111010111001010" }
assert my_solution.minimumSteps(**test_input) == 58

test_input = { "s": "01100010" }
assert my_solution.minimumSteps(**test_input) == 9

test_input = { "s": "10010000010" }
assert my_solution.minimumSteps(**test_input) == 15

test_input = { "s": "11011101000100001" }
assert my_solution.minimumSteps(**test_input) == 53

test_input = { "s": "00" }
assert my_solution.minimumSteps(**test_input) == 0

test_input = { "s": "10100101011001100111" }
assert my_solution.minimumSteps(**test_input) == 40

test_input = { "s": "0101" }
assert my_solution.minimumSteps(**test_input) == 1

test_input = { "s": "00101010100" }
assert my_solution.minimumSteps(**test_input) == 14

test_input = { "s": "00110111110010" }
assert my_solution.minimumSteps(**test_input) == 24

test_input = { "s": "111010000001000001" }
assert my_solution.minimumSteps(**test_input) == 52

test_input = { "s": "0101101000111010" }
assert my_solution.minimumSteps(**test_input) == 31

test_input = { "s": "1010111111" }
assert my_solution.minimumSteps(**test_input) == 3

test_input = { "s": "110110001001110" }
assert my_solution.minimumSteps(**test_input) == 32

test_input = { "s": "111010" }
assert my_solution.minimumSteps(**test_input) == 7

test_input = { "s": "10" }
assert my_solution.minimumSteps(**test_input) == 1

test_input = { "s": "111110" }
assert my_solution.minimumSteps(**test_input) == 5

test_input = { "s": "0111100000101101110" }
assert my_solution.minimumSteps(**test_input) == 42

test_input = { "s": "111010100" }
assert my_solution.minimumSteps(**test_input) == 17

test_input = { "s": "0001000100111000" }
assert my_solution.minimumSteps(**test_input) == 22

test_input = { "s": "011001111110110010" }
assert my_solution.minimumSteps(**test_input) == 43

test_input = { "s": "11100" }
assert my_solution.minimumSteps(**test_input) == 6

test_input = { "s": "0100001101110001" }
assert my_solution.minimumSteps(**test_input) == 25

test_input = { "s": "111" }
assert my_solution.minimumSteps(**test_input) == 0

test_input = { "s": "100010" }
assert my_solution.minimumSteps(**test_input) == 5

test_input = { "s": "101001" }
assert my_solution.minimumSteps(**test_input) == 5

test_input = { "s": "00111010100100100111" }
assert my_solution.minimumSteps(**test_input) == 43

test_input = { "s": "100010111" }
assert my_solution.minimumSteps(**test_input) == 5

test_input = { "s": "001110000101011" }
assert my_solution.minimumSteps(**test_input) == 21

test_input = { "s": "111011011101101" }
assert my_solution.minimumSteps(**test_input) == 26

test_input = { "s": "1110101" }
assert my_solution.minimumSteps(**test_input) == 7

test_input = { "s": "00111010100111" }
assert my_solution.minimumSteps(**test_input) == 17

test_input = { "s": "010" }
assert my_solution.minimumSteps(**test_input) == 1

test_input = { "s": "111001" }
assert my_solution.minimumSteps(**test_input) == 6

test_input = { "s": "1100011" }
assert my_solution.minimumSteps(**test_input) == 6

test_input = { "s": "0110001011001110111" }
assert my_solution.minimumSteps(**test_input) == 27

test_input = { "s": "0001111111011101" }
assert my_solution.minimumSteps(**test_input) == 17

test_input = { "s": "0110110100001" }
assert my_solution.minimumSteps(**test_input) == 26

test_input = { "s": "11110110011000011" }
assert my_solution.minimumSteps(**test_input) == 48

test_input = { "s": "10100" }
assert my_solution.minimumSteps(**test_input) == 5

test_input = { "s": "10100001" }
assert my_solution.minimumSteps(**test_input) == 9

test_input = { "s": "01000011000" }
assert my_solution.minimumSteps(**test_input) == 13

test_input = { "s": "110001001001" }
assert my_solution.minimumSteps(**test_input) == 20

test_input = { "s": "01100011010011110" }
assert my_solution.minimumSteps(**test_input) == 29

test_input = { "s": "01111001111" }
assert my_solution.minimumSteps(**test_input) == 8

test_input = { "s": "1110100010000110110" }
assert my_solution.minimumSteps(**test_input) == 51

test_input = { "s": "1101000111001111100" }
assert my_solution.minimumSteps(**test_input) == 45

test_input = { "s": "0110000" }
assert my_solution.minimumSteps(**test_input) == 8

test_input = { "s": "001010010010" }
assert my_solution.minimumSteps(**test_input) == 15

test_input = { "s": "11101" }
assert my_solution.minimumSteps(**test_input) == 3

test_input = { "s": "00110110" }
assert my_solution.minimumSteps(**test_input) == 6

test_input = { "s": "001010" }
assert my_solution.minimumSteps(**test_input) == 3

test_input = { "s": "000101010101010" }
assert my_solution.minimumSteps(**test_input) == 21

test_input = { "s": "1111011" }
assert my_solution.minimumSteps(**test_input) == 4

test_input = { "s": "0000101011001101011" }
assert my_solution.minimumSteps(**test_input) == 24

test_input = { "s": "011010" }
assert my_solution.minimumSteps(**test_input) == 5

test_input = { "s": "110010100011110101" }
assert my_solution.minimumSteps(**test_input) == 36

test_input = { "s": "000000001" }
assert my_solution.minimumSteps(**test_input) == 0

test_input = { "s": "011001" }
assert my_solution.minimumSteps(**test_input) == 4

test_input = { "s": "01111010011110111111" }
assert my_solution.minimumSteps(**test_input) == 23

test_input = { "s": "10001111" }
assert my_solution.minimumSteps(**test_input) == 3

test_input = { "s": "11011010001111" }
assert my_solution.minimumSteps(**test_input) == 21

test_input = { "s": "0110101010100000111" }
assert my_solution.minimumSteps(**test_input) == 44

test_input = { "s": "0000001000110" }
assert my_solution.minimumSteps(**test_input) == 6

test_input = { "s": "1" }
assert my_solution.minimumSteps(**test_input) == 0

test_input = { "s": "0111100110100" }
assert my_solution.minimumSteps(**test_input) == 28

test_input = { "s": "101010110011101011" }
assert my_solution.minimumSteps(**test_input) == 33

test_input = { "s": "1011101" }
assert my_solution.minimumSteps(**test_input) == 5


maximum-xor-product

Maximum Xor Product

Prompt:
"""
Given three integers a, b, and n, return the maximum value of (a XOR x) * (b XOR x) where 0 <= x < 2n.
Since the answer may be too large, return it modulo 109 + 7.
Note that XOR is the bitwise XOR operation.

Example 1:

Input: a = 12, b = 5, n = 4
Output: 98
Explanation: For x = 2, (a XOR x) = 14 and (b XOR x) = 7. Hence, (a XOR x) * (b XOR x) = 98.
It can be shown that 98 is the maximum value of (a XOR x) * (b XOR x) for all 0 <= x < 2n.

Example 2:

Input: a = 6, b = 7 , n = 5
Output: 930
Explanation: For x = 25, (a XOR x) = 31 and (b XOR x) = 30. Hence, (a XOR x) * (b XOR x) = 930.
It can be shown that 930 is the maximum value of (a XOR x) * (b XOR x) for all 0 <= x < 2n.
Example 3:

Input: a = 1, b = 6, n = 3
Output: 12
Explanation: For x = 5, (a XOR x) = 4 and (b XOR x) = 3. Hence, (a XOR x) * (b XOR x) = 12.
It can be shown that 12 is the maximum value of (a XOR x) * (b XOR x) for all 0 <= x < 2n.

Constraints:

0 <= a, b < 250
0 <= n <= 50
"""
class Solution:
    def maximumXorProduct(self, a: int, b: int, n: int) -> int:

Given three integers a, b, and n, return the maximum value of (a XOR x) * (b XOR x) where 0 <= x < 2n.
Since the answer may be too large, return it modulo 109 + 7.
Note that XOR is the bitwise XOR operation.

Example 1:

Input: a = 12, b = 5, n = 4
Output: 98
Explanation: For x = 2, (a XOR x) = 14 and (b XOR x) = 7. Hence, (a XOR x) * (b XOR x) = 98.
It can be shown that 98 is the maximum value of (a XOR x) * (b XOR x) for all 0 <= x < 2n.

Example 2:

Input: a = 6, b = 7 , n = 5
Output: 930
Explanation: For x = 25, (a XOR x) = 31 and (b XOR x) = 30. Hence, (a XOR x) * (b XOR x) = 930.
It can be shown that 930 is the maximum value of (a XOR x) * (b XOR x) for all 0 <= x < 2n.
Example 3:

Input: a = 1, b = 6, n = 3
Output: 12
Explanation: For x = 5, (a XOR x) = 4 and (b XOR x) = 3. Hence, (a XOR x) * (b XOR x) = 12.
It can be shown that 12 is the maximum value of (a XOR x) * (b XOR x) for all 0 <= x < 2n.

Constraints:

0 <= a, b < 250
0 <= n <= 50

Please complete the code below to solve above prblem:
```python
class Solution:
    def maximumXorProduct(self, a: int, b: int, n: int) -> int:

```

my_solution = Solution()

test_input = { "a": 12, "b": 5, "n": 4 }
assert my_solution.maximumXorProduct(**test_input) == 98

test_input = { "a": 6, "b": 7, "n": 5 }
assert my_solution.maximumXorProduct(**test_input) == 930

test_input = { "a": 1, "b": 6, "n": 3 }
assert my_solution.maximumXorProduct(**test_input) == 12

test_input = { "a": 0, "b": 0, "n": 1 }
assert my_solution.maximumXorProduct(**test_input) == 1

test_input = { "a": 0, "b": 1, "n": 6 }
assert my_solution.maximumXorProduct(**test_input) == 3906

test_input = { "a": 0, "b": 2, "n": 7 }
assert my_solution.maximumXorProduct(**test_input) == 15875

test_input = { "a": 0, "b": 3, "n": 1 }
assert my_solution.maximumXorProduct(**test_input) == 2

test_input = { "a": 0, "b": 4, "n": 0 }
assert my_solution.maximumXorProduct(**test_input) == 0

test_input = { "a": 0, "b": 5, "n": 6 }
assert my_solution.maximumXorProduct(**test_input) == 3658

test_input = { "a": 0, "b": 6, "n": 1 }
assert my_solution.maximumXorProduct(**test_input) == 7

test_input = { "a": 0, "b": 7, "n": 2 }
assert my_solution.maximumXorProduct(**test_input) == 12

test_input = { "a": 0, "b": 8, "n": 5 }
assert my_solution.maximumXorProduct(**test_input) == 713

test_input = { "a": 0, "b": 9, "n": 2 }
assert my_solution.maximumXorProduct(**test_input) == 30

test_input = { "a": 0, "b": 10, "n": 7 }
assert my_solution.maximumXorProduct(**test_input) == 14875

test_input = { "a": 0, "b": 11, "n": 4 }
assert my_solution.maximumXorProduct(**test_input) == 84

test_input = { "a": 0, "b": 12, "n": 2 }
assert my_solution.maximumXorProduct(**test_input) == 45

test_input = { "a": 0, "b": 13, "n": 2 }
assert my_solution.maximumXorProduct(**test_input) == 42

test_input = { "a": 0, "b": 14, "n": 0 }
assert my_solution.maximumXorProduct(**test_input) == 0

test_input = { "a": 0, "b": 15, "n": 6 }
assert my_solution.maximumXorProduct(**test_input) == 3080

test_input = { "a": 1, "b": 0, "n": 3 }
assert my_solution.maximumXorProduct(**test_input) == 42

test_input = { "a": 1, "b": 1, "n": 4 }
assert my_solution.maximumXorProduct(**test_input) == 225

test_input = { "a": 1, "b": 2, "n": 6 }
assert my_solution.maximumXorProduct(**test_input) == 3782

test_input = { "a": 1, "b": 3, "n": 2 }
assert my_solution.maximumXorProduct(**test_input) == 3

test_input = { "a": 1, "b": 4, "n": 5 }
assert my_solution.maximumXorProduct(**test_input) == 810

test_input = { "a": 1, "b": 5, "n": 4 }
assert my_solution.maximumXorProduct(**test_input) == 165

test_input = { "a": 1, "b": 6, "n": 4 }
assert my_solution.maximumXorProduct(**test_input) == 132

test_input = { "a": 1, "b": 7, "n": 2 }
assert my_solution.maximumXorProduct(**test_input) == 15

test_input = { "a": 1, "b": 8, "n": 0 }
assert my_solution.maximumXorProduct(**test_input) == 8

test_input = { "a": 1, "b": 9, "n": 2 }
assert my_solution.maximumXorProduct(**test_input) == 33

test_input = { "a": 1, "b": 10, "n": 7 }
assert my_solution.maximumXorProduct(**test_input) == 14756

test_input = { "a": 1, "b": 11, "n": 7 }
assert my_solution.maximumXorProduct(**test_input) == 14875

test_input = { "a": 1, "b": 12, "n": 7 }
assert my_solution.maximumXorProduct(**test_input) == 14518

test_input = { "a": 1, "b": 13, "n": 0 }
assert my_solution.maximumXorProduct(**test_input) == 13

test_input = { "a": 1, "b": 14, "n": 5 }
assert my_solution.maximumXorProduct(**test_input) == 552

test_input = { "a": 1, "b": 15, "n": 4 }
assert my_solution.maximumXorProduct(**test_input) == 63

test_input = { "a": 2, "b": 0, "n": 0 }
assert my_solution.maximumXorProduct(**test_input) == 0

test_input = { "a": 2, "b": 1, "n": 0 }
assert my_solution.maximumXorProduct(**test_input) == 2

test_input = { "a": 2, "b": 2, "n": 0 }
assert my_solution.maximumXorProduct(**test_input) == 4

test_input = { "a": 2, "b": 3, "n": 5 }
assert my_solution.maximumXorProduct(**test_input) == 930

test_input = { "a": 2, "b": 4, "n": 4 }
assert my_solution.maximumXorProduct(**test_input) == 143

test_input = { "a": 2, "b": 5, "n": 5 }
assert my_solution.maximumXorProduct(**test_input) == 756

test_input = { "a": 2, "b": 6, "n": 4 }
assert my_solution.maximumXorProduct(**test_input) == 165

test_input = { "a": 2, "b": 7, "n": 3 }
assert my_solution.maximumXorProduct(**test_input) == 18

test_input = { "a": 2, "b": 8, "n": 1 }
assert my_solution.maximumXorProduct(**test_input) == 27

test_input = { "a": 2, "b": 9, "n": 2 }
assert my_solution.maximumXorProduct(**test_input) == 24

test_input = { "a": 2, "b": 10, "n": 5 }
assert my_solution.maximumXorProduct(**test_input) == 713

test_input = { "a": 2, "b": 11, "n": 0 }
assert my_solution.maximumXorProduct(**test_input) == 22

test_input = { "a": 2, "b": 12, "n": 2 }
assert my_solution.maximumXorProduct(**test_input) == 39

test_input = { "a": 2, "b": 13, "n": 1 }
assert my_solution.maximumXorProduct(**test_input) == 36

test_input = { "a": 2, "b": 14, "n": 0 }
assert my_solution.maximumXorProduct(**test_input) == 28

test_input = { "a": 2, "b": 15, "n": 2 }
assert my_solution.maximumXorProduct(**test_input) == 42

test_input = { "a": 3, "b": 0, "n": 6 }
assert my_solution.maximumXorProduct(**test_input) == 3782

test_input = { "a": 3, "b": 1, "n": 6 }
assert my_solution.maximumXorProduct(**test_input) == 3843

test_input = { "a": 3, "b": 2, "n": 2 }
assert my_solution.maximumXorProduct(**test_input) == 6

test_input = { "a": 3, "b": 3, "n": 7 }
assert my_solution.maximumXorProduct(**test_input) == 16129

test_input = { "a": 3, "b": 4, "n": 5 }
assert my_solution.maximumXorProduct(**test_input) == 756

test_input = { "a": 3, "b": 5, "n": 4 }
assert my_solution.maximumXorProduct(**test_input) == 143

test_input = { "a": 3, "b": 6, "n": 2 }
assert my_solution.maximumXorProduct(**test_input) == 18

test_input = { "a": 3, "b": 7, "n": 2 }
assert my_solution.maximumXorProduct(**test_input) == 21

test_input = { "a": 3, "b": 8, "n": 6 }
assert my_solution.maximumXorProduct(**test_input) == 3300

test_input = { "a": 3, "b": 9, "n": 1 }
assert my_solution.maximumXorProduct(**test_input) == 27

test_input = { "a": 3, "b": 10, "n": 5 }
assert my_solution.maximumXorProduct(**test_input) == 690

test_input = { "a": 3, "b": 11, "n": 1 }
assert my_solution.maximumXorProduct(**test_input) == 33

test_input = { "a": 3, "b": 12, "n": 1 }
assert my_solution.maximumXorProduct(**test_input) == 36

test_input = { "a": 3, "b": 13, "n": 2 }
assert my_solution.maximumXorProduct(**test_input) == 39

test_input = { "a": 3, "b": 14, "n": 0 }
assert my_solution.maximumXorProduct(**test_input) == 42

test_input = { "a": 3, "b": 15, "n": 6 }
assert my_solution.maximumXorProduct(**test_input) == 3245

test_input = { "a": 4, "b": 0, "n": 4 }
assert my_solution.maximumXorProduct(**test_input) == 165

test_input = { "a": 4, "b": 1, "n": 2 }
assert my_solution.maximumXorProduct(**test_input) == 18

test_input = { "a": 4, "b": 2, "n": 2 }
assert my_solution.maximumXorProduct(**test_input) == 15

test_input = { "a": 4, "b": 3, "n": 0 }
assert my_solution.maximumXorProduct(**test_input) == 12

test_input = { "a": 4, "b": 4, "n": 3 }
assert my_solution.maximumXorProduct(**test_input) == 49

test_input = { "a": 4, "b": 5, "n": 3 }
assert my_solution.maximumXorProduct(**test_input) == 42

test_input = { "a": 4, "b": 6, "n": 2 }
assert my_solution.maximumXorProduct(**test_input) == 35

test_input = { "a": 4, "b": 7, "n": 3 }
assert my_solution.maximumXorProduct(**test_input) == 30

test_input = { "a": 4, "b": 8, "n": 4 }
assert my_solution.maximumXorProduct(**test_input) == 77

test_input = { "a": 4, "b": 9, "n": 7 }
assert my_solution.maximumXorProduct(**test_input) == 14518

test_input = { "a": 4, "b": 10, "n": 0 }
assert my_solution.maximumXorProduct(**test_input) == 40

test_input = { "a": 4, "b": 11, "n": 5 }
assert my_solution.maximumXorProduct(**test_input) == 552

test_input = { "a": 4, "b": 12, "n": 6 }
assert my_solution.maximumXorProduct(**test_input) == 3465

test_input = { "a": 4, "b": 13, "n": 7 }
assert my_solution.maximumXorProduct(**test_input) == 14994

test_input = { "a": 4, "b": 14, "n": 5 }
assert my_solution.maximumXorProduct(**test_input) == 667

test_input = { "a": 4, "b": 15, "n": 6 }
assert my_solution.maximumXorProduct(**test_input) == 3300

test_input = { "a": 5, "b": 0, "n": 1 }
assert my_solution.maximumXorProduct(**test_input) == 4

test_input = { "a": 5, "b": 1, "n": 3 }
assert my_solution.maximumXorProduct(**test_input) == 21

test_input = { "a": 5, "b": 2, "n": 2 }
assert my_solution.maximumXorProduct(**test_input) == 12

test_input = { "a": 5, "b": 3, "n": 7 }
assert my_solution.maximumXorProduct(**test_input) == 15375

test_input = { "a": 5, "b": 4, "n": 7 }
assert my_solution.maximumXorProduct(**test_input) == 16002

test_input = { "a": 5, "b": 5, "n": 0 }
assert my_solution.maximumXorProduct(**test_input) == 25

test_input = { "a": 5, "b": 6, "n": 1 }
assert my_solution.maximumXorProduct(**test_input) == 30

test_input = { "a": 5, "b": 7, "n": 0 }
assert my_solution.maximumXorProduct(**test_input) == 35

test_input = { "a": 5, "b": 8, "n": 2 }
assert my_solution.maximumXorProduct(**test_input) == 70

test_input = { "a": 5, "b": 9, "n": 4 }
assert my_solution.maximumXorProduct(**test_input) == 77

test_input = { "a": 5, "b": 10, "n": 5 }
assert my_solution.maximumXorProduct(**test_input) == 552

test_input = { "a": 5, "b": 11, "n": 7 }
assert my_solution.maximumXorProduct(**test_input) == 14399

test_input = { "a": 5, "b": 12, "n": 1 }
assert my_solution.maximumXorProduct(**test_input) == 60

test_input = { "a": 5, "b": 13, "n": 5 }
assert my_solution.maximumXorProduct(**test_input) == 713

test_input = { "a": 5, "b": 14, "n": 4 }
assert my_solution.maximumXorProduct(**test_input) == 84

test_input = { "a": 5, "b": 15, "n": 0 }
assert my_solution.maximumXorProduct(**test_input) == 75

test_input = { "a": 6, "b": 0, "n": 4 }
assert my_solution.maximumXorProduct(**test_input) == 143


find-building-where-alice-and-bob-can-meet

Find Building Where Alice and Bob Can Meet

Prompt:
"""
You are given a 0-indexed array heights of positive integers, where heights[i] represents the height of the ith building.
If a person is in building i, they can move to any other building j if and only if i < j and heights[i] < heights[j].
You are also given another array queries where queries[i] = [ai, bi]. On the ith query, Alice is in building ai while Bob is in building bi.
Return an array ans where ans[i] is the index of the leftmost building where Alice and Bob can meet on the ith query. If Alice and Bob cannot move to a common building on query i, set ans[i] to -1.

Example 1:

Input: heights = [6,4,8,5,2,7], queries = [[0,1],[0,3],[2,4],[3,4],[2,2]]
Output: [2,5,-1,5,2]
Explanation: In the first query, Alice and Bob can move to building 2 since heights[0] < heights[2] and heights[1] < heights[2].
In the second query, Alice and Bob can move to building 5 since heights[0] < heights[5] and heights[3] < heights[5].
In the third query, Alice cannot meet Bob since Alice cannot move to any other building.
In the fourth query, Alice and Bob can move to building 5 since heights[3] < heights[5] and heights[4] < heights[5].
In the fifth query, Alice and Bob are already in the same building.
For ans[i] != -1, It can be shown that ans[i] is the leftmost building where Alice and Bob can meet.
For ans[i] == -1, It can be shown that there is no building where Alice and Bob can meet.

Example 2:

Input: heights = [5,3,8,2,6,1,4,6], queries = [[0,7],[3,5],[5,2],[3,0],[1,6]]
Output: [7,6,-1,4,6]
Explanation: In the first query, Alice can directly move to Bob's building since heights[0] < heights[7].
In the second query, Alice and Bob can move to building 6 since heights[3] < heights[6] and heights[5] < heights[6].
In the third query, Alice cannot meet Bob since Bob cannot move to any other building.
In the fourth query, Alice and Bob can move to building 4 since heights[3] < heights[4] and heights[0] < heights[4].
In the fifth query, Alice can directly move to Bob's building since heights[1] < heights[6].
For ans[i] != -1, It can be shown that ans[i] is the leftmost building where Alice and Bob can meet.
For ans[i] == -1, It can be shown that there is no building where Alice and Bob can meet.

Constraints:

1 <= heights.length <= 5 * 104
1 <= heights[i] <= 109
1 <= queries.length <= 5 * 104
queries[i] = [ai, bi]
0 <= ai, bi <= heights.length - 1
"""
class Solution:
    def leftmostBuildingQueries(self, heights: List[int], queries: List[List[int]]) -> List[int]:

You are given a 0-indexed array heights of positive integers, where heights[i] represents the height of the ith building.
If a person is in building i, they can move to any other building j if and only if i < j and heights[i] < heights[j].
You are also given another array queries where queries[i] = [ai, bi]. On the ith query, Alice is in building ai while Bob is in building bi.
Return an array ans where ans[i] is the index of the leftmost building where Alice and Bob can meet on the ith query. If Alice and Bob cannot move to a common building on query i, set ans[i] to -1.

Example 1:

Input: heights = [6,4,8,5,2,7], queries = [[0,1],[0,3],[2,4],[3,4],[2,2]]
Output: [2,5,-1,5,2]
Explanation: In the first query, Alice and Bob can move to building 2 since heights[0] < heights[2] and heights[1] < heights[2].
In the second query, Alice and Bob can move to building 5 since heights[0] < heights[5] and heights[3] < heights[5].
In the third query, Alice cannot meet Bob since Alice cannot move to any other building.
In the fourth query, Alice and Bob can move to building 5 since heights[3] < heights[5] and heights[4] < heights[5].
In the fifth query, Alice and Bob are already in the same building.
For ans[i] != -1, It can be shown that ans[i] is the leftmost building where Alice and Bob can meet.
For ans[i] == -1, It can be shown that there is no building where Alice and Bob can meet.

Example 2:

Input: heights = [5,3,8,2,6,1,4,6], queries = [[0,7],[3,5],[5,2],[3,0],[1,6]]
Output: [7,6,-1,4,6]
Explanation: In the first query, Alice can directly move to Bob's building since heights[0] < heights[7].
In the second query, Alice and Bob can move to building 6 since heights[3] < heights[6] and heights[5] < heights[6].
In the third query, Alice cannot meet Bob since Bob cannot move to any other building.
In the fourth query, Alice and Bob can move to building 4 since heights[3] < heights[4] and heights[0] < heights[4].
In the fifth query, Alice can directly move to Bob's building since heights[1] < heights[6].
For ans[i] != -1, It can be shown that ans[i] is the leftmost building where Alice and Bob can meet.
For ans[i] == -1, It can be shown that there is no building where Alice and Bob can meet.

Constraints:

1 <= heights.length <= 5 * 104
1 <= heights[i] <= 109
1 <= queries.length <= 5 * 104
queries[i] = [ai, bi]
0 <= ai, bi <= heights.length - 1

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

```


maximum-strong-pair-xor-i

Maximum Strong Pair XOR I

Prompt:
"""
You are given a 0-indexed integer array nums. A pair of integers x and y is called a strong pair if it satisfies the condition:

|x - y| <= min(x, y)

You need to select two integers from nums such that they form a strong pair and their bitwise XOR is the maximum among all strong pairs in the array.
Return the maximum XOR value out of all possible strong pairs in the array nums.
Note that you can pick the same integer twice to form a pair.

Example 1:

Input: nums = [1,2,3,4,5]
Output: 7
Explanation: There are 11 strong pairs in the array nums: (1, 1), (1, 2), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (3, 5), (4, 4), (4, 5) and (5, 5).
The maximum XOR possible from these pairs is 3 XOR 4 = 7.

Example 2:

Input: nums = [10,100]
Output: 0
Explanation: There are 2 strong pairs in the array nums: (10, 10) and (100, 100).
The maximum XOR possible from these pairs is 10 XOR 10 = 0 since the pair (100, 100) also gives 100 XOR 100 = 0.

Example 3:

Input: nums = [5,6,25,30]
Output: 7
Explanation: There are 6 strong pairs in the array nums: (5, 5), (5, 6), (6, 6), (25, 25), (25, 30) and (30, 30).
The maximum XOR possible from these pairs is 25 XOR 30 = 7 since the only other non-zero XOR value is 5 XOR 6 = 3.

Constraints:

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

You are given a 0-indexed integer array nums. A pair of integers x and y is called a strong pair if it satisfies the condition:

|x - y| <= min(x, y)

You need to select two integers from nums such that they form a strong pair and their bitwise XOR is the maximum among all strong pairs in the array.
Return the maximum XOR value out of all possible strong pairs in the array nums.
Note that you can pick the same integer twice to form a pair.

Example 1:

Input: nums = [1,2,3,4,5]
Output: 7
Explanation: There are 11 strong pairs in the array nums: (1, 1), (1, 2), (2, 2), (2, 3), (2, 4), (3, 3), (3, 4), (3, 5), (4, 4), (4, 5) and (5, 5).
The maximum XOR possible from these pairs is 3 XOR 4 = 7.

Example 2:

Input: nums = [10,100]
Output: 0
Explanation: There are 2 strong pairs in the array nums: (10, 10) and (100, 100).
The maximum XOR possible from these pairs is 10 XOR 10 = 0 since the pair (100, 100) also gives 100 XOR 100 = 0.

Example 3:

Input: nums = [5,6,25,30]
Output: 7
Explanation: There are 6 strong pairs in the array nums: (5, 5), (5, 6), (6, 6), (25, 25), (25, 30) and (30, 30).
The maximum XOR possible from these pairs is 25 XOR 30 = 7 since the only other non-zero XOR value is 5 XOR 6 = 3.

Constraints:

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

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

```

my_solution = Solution()

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

test_input = { "nums": [10,100] }
assert my_solution.maximumStrongPairXor(**test_input) == 0

test_input = { "nums": [5,6,25,30] }
assert my_solution.maximumStrongPairXor(**test_input) == 7

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

test_input = { "nums": [100] }
assert my_solution.maximumStrongPairXor(**test_input) == 0

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

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

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

test_input = { "nums": [1,1,6,6,9] }
assert my_solution.maximumStrongPairXor(**test_input) == 15

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

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

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

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

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

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

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

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

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

test_input = { "nums": [1,3,9,6,5] }
assert my_solution.maximumStrongPairXor(**test_input) == 15

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

test_input = { "nums": [1,4,3,9,7] }
assert my_solution.maximumStrongPairXor(**test_input) == 14

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

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

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

test_input = { "nums": [1,5,1,9,1] }
assert my_solution.maximumStrongPairXor(**test_input) == 12

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

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

test_input = { "nums": [1,5,9,1,2] }
assert my_solution.maximumStrongPairXor(**test_input) == 12

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

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

test_input = { "nums": [1,6,3,3,10] }
assert my_solution.maximumStrongPairXor(**test_input) == 12

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

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

test_input = { "nums": [1,6,5,5,8] }
assert my_solution.maximumStrongPairXor(**test_input) == 14

test_input = { "nums": [1,6,6,1,9] }
assert my_solution.maximumStrongPairXor(**test_input) == 15

test_input = { "nums": [1,6,8,5,3] }
assert my_solution.maximumStrongPairXor(**test_input) == 14

test_input = { "nums": [1,6,8,10,3] }
assert my_solution.maximumStrongPairXor(**test_input) == 14

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

test_input = { "nums": [1,6,10,1,2] }
assert my_solution.maximumStrongPairXor(**test_input) == 12

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

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

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

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

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

test_input = { "nums": [1,8,1,1,8] }
assert my_solution.maximumStrongPairXor(**test_input) == 0

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

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

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

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

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

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

test_input = { "nums": [1,9,6,5,7] }
assert my_solution.maximumStrongPairXor(**test_input) == 15

test_input = { "nums": [1,9,6,8,1] }
assert my_solution.maximumStrongPairXor(**test_input) == 15

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

test_input = { "nums": [1,9,8,9,6] }
assert my_solution.maximumStrongPairXor(**test_input) == 15

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

test_input = { "nums": [1,10,1,1,1] }
assert my_solution.maximumStrongPairXor(**test_input) == 0

test_input = { "nums": [1,10,5,10,6] }
assert my_solution.maximumStrongPairXor(**test_input) == 15

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

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

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

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

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

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

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

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

test_input = { "nums": [2,2,5,10,6] }
assert my_solution.maximumStrongPairXor(**test_input) == 15

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

test_input = { "nums": [2,2,10,5,9] }
assert my_solution.maximumStrongPairXor(**test_input) == 15

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

test_input = { "nums": [2,3,8,8,10] }
assert my_solution.maximumStrongPairXor(**test_input) == 2

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

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

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

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

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

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

test_input = { "nums": [2,4,10,7,8] }
assert my_solution.maximumStrongPairXor(**test_input) == 15

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

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

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

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

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

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

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

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

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

test_input = { "nums": [2,6,8,6,10] }
assert my_solution.maximumStrongPairXor(**test_input) == 14

test_input = { "nums": [2,6,10,5,4] }
assert my_solution.maximumStrongPairXor(**test_input) == 15

test_input = { "nums": [2,7,1,8,9] }
assert my_solution.maximumStrongPairXor(**test_input) == 15

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

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

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

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

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

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

test_input = { "nums": [2,8,7,10,3] }
assert my_solution.maximumStrongPairXor(**test_input) == 15

test_input = { "nums": [2,9,1,7,7] }
assert my_solution.maximumStrongPairXor(**test_input) == 14

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

test_input = { "nums": [2,9,5,10,10] }
assert my_solution.maximumStrongPairXor(**test_input) == 15


high-access-employees

High-Access Employees

Prompt:
"""
You are given a 2D 0-indexed array of strings, access_times, with size n. For each i where 0 <= i <= n - 1, access_times[i][0] represents the name of an employee, and access_times[i][1] represents the access time of that employee. All entries in access_times are within the same day.
The access time is represented as four digits using a 24-hour time format, for example, "0800" or "2250".
An employee is said to be high-access if he has accessed the system three or more times within a one-hour period.
Times with exactly one hour of difference are not considered part of the same one-hour period. For example, "0815" and "0915" are not part of the same one-hour period.
Access times at the start and end of the day are not counted within the same one-hour period. For example, "0005" and "2350" are not part of the same one-hour period.
Return a list that contains the names of high-access employees with any order you want.

Example 1:

Input: access_times = [["a","0549"],["b","0457"],["a","0532"],["a","0621"],["b","0540"]]
Output: ["a"]
Explanation: "a" has three access times in the one-hour period of [05:32, 06:31] which are 05:32, 05:49, and 06:21.
But "b" does not have more than two access times at all.
So the answer is ["a"].
Example 2:

Input: access_times = [["d","0002"],["c","0808"],["c","0829"],["e","0215"],["d","1508"],["d","1444"],["d","1410"],["c","0809"]]
Output: ["c","d"]
Explanation: "c" has three access times in the one-hour period of [08:08, 09:07] which are 08:08, 08:09, and 08:29.
"d" has also three access times in the one-hour period of [14:10, 15:09] which are 14:10, 14:44, and 15:08.
However, "e" has just one access time, so it can not be in the answer and the final answer is ["c","d"].
Example 3:

Input: access_times = [["cd","1025"],["ab","1025"],["cd","1046"],["cd","1055"],["ab","1124"],["ab","1120"]]
Output: ["ab","cd"]
Explanation: "ab" has three access times in the one-hour period of [10:25, 11:24] which are 10:25, 11:20, and 11:24.
"cd" has also three access times in the one-hour period of [10:25, 11:24] which are 10:25, 10:46, and 10:55.
So the answer is ["ab","cd"].

Constraints:

1 <= access_times.length <= 100
access_times[i].length == 2
1 <= access_times[i][0].length <= 10
access_times[i][0] consists only of English small letters.
access_times[i][1].length == 4
access_times[i][1] is in 24-hour time format.
access_times[i][1] consists only of '0' to '9'.
"""
class Solution:
    def findHighAccessEmployees(self, access_times: List[List[str]]) -> List[str]:

You are given a 2D 0-indexed array of strings, access_times, with size n. For each i where 0 <= i <= n - 1, access_times[i][0] represents the name of an employee, and access_times[i][1] represents the access time of that employee. All entries in access_times are within the same day.
The access time is represented as four digits using a 24-hour time format, for example, "0800" or "2250".
An employee is said to be high-access if he has accessed the system three or more times within a one-hour period.
Times with exactly one hour of difference are not considered part of the same one-hour period. For example, "0815" and "0915" are not part of the same one-hour period.
Access times at the start and end of the day are not counted within the same one-hour period. For example, "0005" and "2350" are not part of the same one-hour period.
Return a list that contains the names of high-access employees with any order you want.

Example 1:

Input: access_times = [["a","0549"],["b","0457"],["a","0532"],["a","0621"],["b","0540"]]
Output: ["a"]
Explanation: "a" has three access times in the one-hour period of [05:32, 06:31] which are 05:32, 05:49, and 06:21.
But "b" does not have more than two access times at all.
So the answer is ["a"].
Example 2:

Input: access_times = [["d","0002"],["c","0808"],["c","0829"],["e","0215"],["d","1508"],["d","1444"],["d","1410"],["c","0809"]]
Output: ["c","d"]
Explanation: "c" has three access times in the one-hour period of [08:08, 09:07] which are 08:08, 08:09, and 08:29.
"d" has also three access times in the one-hour period of [14:10, 15:09] which are 14:10, 14:44, and 15:08.
However, "e" has just one access time, so it can not be in the answer and the final answer is ["c","d"].
Example 3:

Input: access_times = [["cd","1025"],["ab","1025"],["cd","1046"],["cd","1055"],["ab","1124"],["ab","1120"]]
Output: ["ab","cd"]
Explanation: "ab" has three access times in the one-hour period of [10:25, 11:24] which are 10:25, 11:20, and 11:24.
"cd" has also three access times in the one-hour period of [10:25, 11:24] which are 10:25, 10:46, and 10:55.
So the answer is ["ab","cd"].

Constraints:

1 <= access_times.length <= 100
access_times[i].length == 2
1 <= access_times[i][0].length <= 10
access_times[i][0] consists only of English small letters.
access_times[i][1].length == 4
access_times[i][1] is in 24-hour time format.
access_times[i][1] consists only of '0' to '9'.

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

```

my_solution = Solution()

test_input = { "access_times": [["a","0549"],["b","0457"],["a","0532"],["a","0621"],["b","0540"]] }
assert my_solution.findHighAccessEmployees(**test_input) == ["a"]

test_input = { "access_times": [["d","0002"],["c","0808"],["c","0829"],["e","0215"],["d","1508"],["d","1444"],["d","1410"],["c","0809"]] }
assert my_solution.findHighAccessEmployees(**test_input) == ["c","d"]

test_input = { "access_times": [["cd","1025"],["ab","1025"],["cd","1046"],["cd","1055"],["ab","1124"],["ab","1120"]] }
assert my_solution.findHighAccessEmployees(**test_input) == ["ab","cd"]

test_input = { "access_times": [["baipstt","1456"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["bouo","1126"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["cavfbqg","2304"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["cenjcq","1007"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["cqotrwqcaq","0131"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["downbuk","1951"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["dqsoiyz","2204"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["duzeyrov","0243"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["erfg","1223"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["fwhefd","2026"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["gbefbne","0911"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["gp","1540"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["ht","1319"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["inahnsjdqz","1750"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["jwxvijxo","0851"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["kibwwvjuez","0716"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["lvry","0706"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["mbsyxxfzjf","0114"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["mlehvzqb","1620"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["mmgat","0516"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["mxatapbs","2240"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["mzxbgtfc","1531"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["nnhh","1445"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["o","1414"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["qaxqifxxww","1557"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["rjy","0200"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["sgpgh","0539"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["sxx","0325"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["tkvgcf","1645"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["ttk","0304"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["un","0833"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["vlifcdn","0731"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["w","2224"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["wkmehwsg","2023"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["y","1005"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["ynnale","1331"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["yt","0900"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["zbgzk","0527"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["a","0039"],["a","0042"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["ajhzcltqse","0605"],["ajhzcltqse","0558"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["cbaqsymoi","0001"],["cbaqsymoi","0004"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["df","1958"],["df","2002"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["dhmnhvou","0529"],["dhmnhvou","0531"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["epghzrog","0333"],["epghzrog","0333"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["gda","1529"],["gda","1534"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["gjhtgm","2207"],["gjhtgm","2156"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["gsd","2030"],["gsd","2046"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["gsstuktwm","1403"],["gsstuktwm","1357"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["h","2159"],["h","2203"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["hxrdffk","1736"],["hxrdffk","1724"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["iaxsnenx","2037"],["iaxsnenx","2050"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["ikwjvflxq","0055"],["ikwjvflxq","0056"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["jkgjmku","0743"],["jkgjmku","0754"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["jkw","0241"],["jkw","0235"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["jykugiprxf","1633"],["jykugiprxf","1641"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["kdxw","1338"],["kdxw","1336"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["kenltmrg","0932"],["kenltmrg","0941"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["kptjrr","1356"],["kptjrr","1349"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["mcd","1333"],["mcd","1325"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["mhkizga","1552"],["mhkizga","1551"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["monxm","1748"],["monxm","1742"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["msjydtinfy","1301"],["msjydtinfy","1245"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["myhdmu","1407"],["myhdmu","1419"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["nyoezc","1050"],["nyoezc","1041"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["oksvrskxch","0053"],["oksvrskxch","0111"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["pxc","1915"],["pxc","1910"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["qedxyj","0609"],["qedxyj","0614"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["qmslkyxnph","0946"],["qmslkyxnph","0958"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["r","0206"],["r","0202"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["r","2041"],["r","2052"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["rf","2205"],["rf","2203"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["rswegeuhqd","0235"],["rswegeuhqd","0238"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["skfgl","0718"],["skfgl","0712"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["smnnl","2329"],["smnnl","2340"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["tpbbxpx","0409"],["tpbbxpx","0408"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["uiqxqp","0515"],["uiqxqp","0516"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["uyuz","1530"],["uyuz","1543"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["vfeunkee","1500"],["vfeunkee","1508"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["wbyd","1848"],["wbyd","1839"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["x","0522"],["x","0506"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["xhrhdy","1455"],["xhrhdy","1454"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["xmsypay","1605"],["xmsypay","1612"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["xy","0015"],["xy","0021"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["ydtnnpzw","0516"],["ydtnnpzw","0520"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["zh","2348"],["zh","2334"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["zinywjn","0017"],["zinywjn","0019"]] }
assert my_solution.findHighAccessEmployees(**test_input) == []

test_input = { "access_times": [["aczdfmsd","0317"],["aczdfmsd","0314"],["aczdfmsd","0320"]] }
assert my_solution.findHighAccessEmployees(**test_input) == ["aczdfmsd"]

test_input = { "access_times": [["bsluadumi","1518"],["bsluadumi","1516"],["bsluadumi","1510"]] }
assert my_solution.findHighAccessEmployees(**test_input) == ["bsluadumi"]

test_input = { "access_times": [["ckrdpxq","1122"],["ckrdpxq","1125"],["ckrdpxq","1121"]] }
assert my_solution.findHighAccessEmployees(**test_input) == ["ckrdpxq"]

test_input = { "access_times": [["fe","1320"],["fe","1326"],["fe","1331"]] }
assert my_solution.findHighAccessEmployees(**test_input) == ["fe"]

test_input = { "access_times": [["ff","1508"],["ff","1508"],["ff","1516"]] }
assert my_solution.findHighAccessEmployees(**test_input) == ["ff"]

test_input = { "access_times": [["fnlmbcedu","0052"],["fnlmbcedu","0103"],["fnlmbcedu","0055"]] }
assert my_solution.findHighAccessEmployees(**test_input) == ["fnlmbcedu"]

test_input = { "access_times": [["hffgwjjve","0159"],["hffgwjjve","0152"],["hffgwjjve","0159"]] }
assert my_solution.findHighAccessEmployees(**test_input) == ["hffgwjjve"]

test_input = { "access_times": [["ivlvfgwsx","0122"],["ivlvfgwsx","0135"],["ivlvfgwsx","0139"]] }
assert my_solution.findHighAccessEmployees(**test_input) == ["ivlvfgwsx"]

test_input = { "access_times": [["jlfnksqlt","0304"],["jlfnksqlt","0252"],["jlfnksqlt","0304"]] }
assert my_solution.findHighAccessEmployees(**test_input) == ["jlfnksqlt"]

test_input = { "access_times": [["jy","0647"],["jy","0652"],["jy","0704"]] }
assert my_solution.findHighAccessEmployees(**test_input) == ["jy"]

test_input = { "access_times": [["kchzzdso","2329"],["kchzzdso","2326"],["kchzzdso","2329"]] }
assert my_solution.findHighAccessEmployees(**test_input) == ["kchzzdso"]