minimum-moves-to-capture-the-queen

Minimum Moves to Capture The Queen

Prompt:
"""
There is a 1-indexed 8 x 8 chessboard containing 3 pieces.
You are given 6 integers a, b, c, d, e, and f where:

(a, b) denotes the position of the white rook.
(c, d) denotes the position of the white bishop.
(e, f) denotes the position of the black queen.

Given that you can only move the white pieces, return the minimum number of moves required to capture the black queen.
Note that:

Rooks can move any number of squares either vertically or horizontally, but cannot jump over other pieces.
Bishops can move any number of squares diagonally, but cannot jump over other pieces.
A rook or a bishop can capture the queen if it is located in a square that they can move to.
The queen does not move.

Example 1:

Input: a = 1, b = 1, c = 8, d = 8, e = 2, f = 3
Output: 2
Explanation: We can capture the black queen in two moves by moving the white rook to (1, 3) then to (2, 3).
It is impossible to capture the black queen in less than two moves since it is not being attacked by any of the pieces at the beginning.

Example 2:

Input: a = 5, b = 3, c = 3, d = 4, e = 5, f = 2
Output: 1
Explanation: We can capture the black queen in a single move by doing one of the following:
- Move the white rook to (5, 2).
- Move the white bishop to (5, 2).

Constraints:

1 <= a, b, c, d, e, f <= 8
No two pieces are on the same square.
"""
class Solution:
    def minMovesToCaptureTheQueen(self, a: int, b: int, c: int, d: int, e: int, f: int) -> int:

There is a 1-indexed 8 x 8 chessboard containing 3 pieces.
You are given 6 integers a, b, c, d, e, and f where:

(a, b) denotes the position of the white rook.
(c, d) denotes the position of the white bishop.
(e, f) denotes the position of the black queen.

Given that you can only move the white pieces, return the minimum number of moves required to capture the black queen.
Note that:

Rooks can move any number of squares either vertically or horizontally, but cannot jump over other pieces.
Bishops can move any number of squares diagonally, but cannot jump over other pieces.
A rook or a bishop can capture the queen if it is located in a square that they can move to.
The queen does not move.

Example 1:

Input: a = 1, b = 1, c = 8, d = 8, e = 2, f = 3
Output: 2
Explanation: We can capture the black queen in two moves by moving the white rook to (1, 3) then to (2, 3).
It is impossible to capture the black queen in less than two moves since it is not being attacked by any of the pieces at the beginning.

Example 2:

Input: a = 5, b = 3, c = 3, d = 4, e = 5, f = 2
Output: 1
Explanation: We can capture the black queen in a single move by doing one of the following:
- Move the white rook to (5, 2).
- Move the white bishop to (5, 2).

Constraints:

1 <= a, b, c, d, e, f <= 8
No two pieces are on the same square.

Please complete the code below to solve above prblem:
```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:
"""
You are given two 0-indexed integer arrays nums1 and nums2 of even length n.
You must remove n / 2 elements from nums1 and n / 2 elements from nums2. After the removals, you insert the remaining elements of nums1 and nums2 into a set s.
Return the maximum possible size of the set s.

Example 1:

Input: nums1 = [1,2,1,2], nums2 = [1,1,1,1]
Output: 2
Explanation: We remove two occurences of 1 from nums1 and nums2. After the removals, the arrays become equal to nums1 = [2,2] and nums2 = [1,1]. Therefore, s = {1,2}.
It can be shown that 2 is the maximum possible size of the set s after the removals.

Example 2:

Input: nums1 = [1,2,3,4,5,6], nums2 = [2,3,2,3,2,3]
Output: 5
Explanation: We remove 2, 3, and 6 from nums1, as well as 2 and two occurrences of 3 from nums2. After the removals, the arrays become equal to nums1 = [1,4,5] and nums2 = [2,3,2]. Therefore, s = {1,2,3,4,5}.
It can be shown that 5 is the maximum possible size of the set s after the removals.

Example 3:

Input: nums1 = [1,1,2,2,3,3], nums2 = [4,4,5,5,6,6]
Output: 6
Explanation: We remove 1, 2, and 3 from nums1, as well as 4, 5, and 6 from nums2. After the removals, the arrays become equal to nums1 = [1,2,3] and nums2 = [4,5,6]. Therefore, s = {1,2,3,4,5,6}.
It can be shown that 6 is the maximum possible size of the set s after the removals.

Constraints:

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

You are given two 0-indexed integer arrays nums1 and nums2 of even length n.
You must remove n / 2 elements from nums1 and n / 2 elements from nums2. After the removals, you insert the remaining elements of nums1 and nums2 into a set s.
Return the maximum possible size of the set s.

Example 1:

Input: nums1 = [1,2,1,2], nums2 = [1,1,1,1]
Output: 2
Explanation: We remove two occurences of 1 from nums1 and nums2. After the removals, the arrays become equal to nums1 = [2,2] and nums2 = [1,1]. Therefore, s = {1,2}.
It can be shown that 2 is the maximum possible size of the set s after the removals.

Example 2:

Input: nums1 = [1,2,3,4,5,6], nums2 = [2,3,2,3,2,3]
Output: 5
Explanation: We remove 2, 3, and 6 from nums1, as well as 2 and two occurrences of 3 from nums2. After the removals, the arrays become equal to nums1 = [1,4,5] and nums2 = [2,3,2]. Therefore, s = {1,2,3,4,5}.
It can be shown that 5 is the maximum possible size of the set s after the removals.

Example 3:

Input: nums1 = [1,1,2,2,3,3], nums2 = [4,4,5,5,6,6]
Output: 6
Explanation: We remove 1, 2, and 3 from nums1, as well as 4, 5, and 6 from nums2. After the removals, the arrays become equal to nums1 = [1,2,3] and nums2 = [4,5,6]. Therefore, s = {1,2,3,4,5,6}.
It can be shown that 6 is the maximum possible size of the set s after the removals.

Constraints:

n == nums1.length == nums2.length
1 <= n <= 2 * 104
n is even.
1 <= nums1[i], nums2[i] <= 109

Please complete the code below to solve above prblem:
```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


maximize-the-number-of-partitions-after-operations

Maximize the Number of Partitions After Operations

Prompt:
"""
You are given a 0-indexed string s and an integer k.
You are to perform the following partitioning operations until s is empty:

Choose the longest prefix of s containing at most k distinct characters.
Delete the prefix from s and increase the number of partitions by one. The remaining characters (if any) in s maintain their initial order.

Before the operations, you are allowed to change at most one index in s to another lowercase English letter.
Return an integer denoting the maximum number of resulting partitions after the operations by optimally choosing at most one index to change.

Example 1:

Input: s = "accca", k = 2
Output: 3
Explanation: In this example, to maximize the number of resulting partitions, s[2] can be changed to 'b'.
s becomes "acbca".
The operations can now be performed as follows until s becomes empty:
- Choose the longest prefix containing at most 2 distinct characters, "acbca".
- Delete the prefix, and s becomes "bca". The number of partitions is now 1.
- Choose the longest prefix containing at most 2 distinct characters, "bca".
- Delete the prefix, and s becomes "a". The number of partitions is now 2.
- Choose the longest prefix containing at most 2 distinct characters, "a".
- Delete the prefix, and s becomes empty. The number of partitions is now 3.
Hence, the answer is 3.
It can be shown that it is not possible to obtain more than 3 partitions.
Example 2:

Input: s = "aabaab", k = 3
Output: 1
Explanation: In this example, to maximize the number of resulting partitions we can leave s as it is.
The operations can now be performed as follows until s becomes empty:
- Choose the longest prefix containing at most 3 distinct characters, "aabaab".
- Delete the prefix, and s becomes empty. The number of partitions becomes 1.
Hence, the answer is 1.
It can be shown that it is not possible to obtain more than 1 partition.

Example 3:

Input: s = "xxyz", k = 1
Output: 4
Explanation: In this example, to maximize the number of resulting partitions, s[1] can be changed to 'a'.
s becomes "xayz".
The operations can now be performed as follows until s becomes empty:
- Choose the longest prefix containing at most 1 distinct character, "xayz".
- Delete the prefix, and s becomes "ayz". The number of partitions is now 1.
- Choose the longest prefix containing at most 1 distinct character, "ayz".
- Delete the prefix, and s becomes "yz". The number of partitions is now 2.
- Choose the longest prefix containing at most 1 distinct character, "yz".
- Delete the prefix, and s becomes "z". The number of partitions is now 3.
- Choose the longest prefix containing at most 1 distinct character, "z".
- Delete the prefix, and s becomes empty. The number of partitions is now 4.
Hence, the answer is 4.
It can be shown that it is not possible to obtain more than 4 partitions.

Constraints:

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

You are given a 0-indexed string s and an integer k.
You are to perform the following partitioning operations until s is empty:

Choose the longest prefix of s containing at most k distinct characters.
Delete the prefix from s and increase the number of partitions by one. The remaining characters (if any) in s maintain their initial order.

Before the operations, you are allowed to change at most one index in s to another lowercase English letter.
Return an integer denoting the maximum number of resulting partitions after the operations by optimally choosing at most one index to change.

Example 1:

Input: s = "accca", k = 2
Output: 3
Explanation: In this example, to maximize the number of resulting partitions, s[2] can be changed to 'b'.
s becomes "acbca".
The operations can now be performed as follows until s becomes empty:
- Choose the longest prefix containing at most 2 distinct characters, "acbca".
- Delete the prefix, and s becomes "bca". The number of partitions is now 1.
- Choose the longest prefix containing at most 2 distinct characters, "bca".
- Delete the prefix, and s becomes "a". The number of partitions is now 2.
- Choose the longest prefix containing at most 2 distinct characters, "a".
- Delete the prefix, and s becomes empty. The number of partitions is now 3.
Hence, the answer is 3.
It can be shown that it is not possible to obtain more than 3 partitions.
Example 2:

Input: s = "aabaab", k = 3
Output: 1
Explanation: In this example, to maximize the number of resulting partitions we can leave s as it is.
The operations can now be performed as follows until s becomes empty:
- Choose the longest prefix containing at most 3 distinct characters, "aabaab".
- Delete the prefix, and s becomes empty. The number of partitions becomes 1.
Hence, the answer is 1.
It can be shown that it is not possible to obtain more than 1 partition.

Example 3:

Input: s = "xxyz", k = 1
Output: 4
Explanation: In this example, to maximize the number of resulting partitions, s[1] can be changed to 'a'.
s becomes "xayz".
The operations can now be performed as follows until s becomes empty:
- Choose the longest prefix containing at most 1 distinct character, "xayz".
- Delete the prefix, and s becomes "ayz". The number of partitions is now 1.
- Choose the longest prefix containing at most 1 distinct character, "ayz".
- Delete the prefix, and s becomes "yz". The number of partitions is now 2.
- Choose the longest prefix containing at most 1 distinct character, "yz".
- Delete the prefix, and s becomes "z". The number of partitions is now 3.
- Choose the longest prefix containing at most 1 distinct character, "z".
- Delete the prefix, and s becomes empty. The number of partitions is now 4.
Hence, the answer is 4.
It can be shown that it is not possible to obtain more than 4 partitions.

Constraints:

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

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

```

my_solution = Solution()

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

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

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

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

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

test_input = { "s": "h", "k": 17 }
assert my_solution.maxPartitionsAfterOperations(**test_input) == 1

test_input = { "s": "p", "k": 13 }
assert my_solution.maxPartitionsAfterOperations(**test_input) == 1

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

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

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

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

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

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

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

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

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

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

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

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

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

test_input = { "s": "fjz", "k": 11 }
assert my_solution.maxPartitionsAfterOperations(**test_input) == 1

test_input = { "s": "jxg", "k": 23 }
assert my_solution.maxPartitionsAfterOperations(**test_input) == 1

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

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

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

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

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

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

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

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

test_input = { "s": "toqm", "k": 14 }
assert my_solution.maxPartitionsAfterOperations(**test_input) == 1

test_input = { "s": "yhbo", "k": 9 }
assert my_solution.maxPartitionsAfterOperations(**test_input) == 1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

test_input = { "s": "odxttm", "k": 19 }
assert my_solution.maxPartitionsAfterOperations(**test_input) == 1

test_input = { "s": "uxqozq", "k": 11 }
assert my_solution.maxPartitionsAfterOperations(**test_input) == 1

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

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

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

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

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

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

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

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

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

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

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

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

test_input = { "s": "tmdhzhy", "k": 26 }
assert my_solution.maxPartitionsAfterOperations(**test_input) == 1

test_input = { "s": "abhujxlb", "k": 13 }
assert my_solution.maxPartitionsAfterOperations(**test_input) == 1

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

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

test_input = { "s": "adklnsqm", "k": 13 }
assert my_solution.maxPartitionsAfterOperations(**test_input) == 1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

test_input = { "s": "vwfyagymtp", "k": 20 }
assert my_solution.maxPartitionsAfterOperations(**test_input) == 1

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

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

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

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

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

test_input = { "s": "yyogqjsswyn", "k": 17 }
assert my_solution.maxPartitionsAfterOperations(**test_input) == 1

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

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


smallest-missing-integer-greater-than-sequential-prefix-sum

Smallest Missing Integer Greater Than Sequential Prefix Sum

Prompt:
"""
You are given a 0-indexed array of integers nums.
A prefix nums[0..i] is sequential if, for all 1 <= j <= i, nums[j] = nums[j - 1] + 1. In particular, the prefix consisting only of nums[0] is sequential.
Return the smallest integer x missing from nums such that x is greater than or equal to the sum of the longest sequential prefix.

Example 1:

Input: nums = [1,2,3,2,5]
Output: 6
Explanation: The longest sequential prefix of nums is [1,2,3] with a sum of 6. 6 is not in the array, therefore 6 is the smallest missing integer greater than or equal to the sum of the longest sequential prefix.

Example 2:

Input: nums = [3,4,5,1,12,14,13]
Output: 15
Explanation: The longest sequential prefix of nums is [3,4,5] with a sum of 12. 12, 13, and 14 belong to the array while 15 does not. Therefore 15 is the smallest missing integer greater than or equal to the sum of the longest sequential prefix.

Constraints:

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

You are given a 0-indexed array of integers nums.
A prefix nums[0..i] is sequential if, for all 1 <= j <= i, nums[j] = nums[j - 1] + 1. In particular, the prefix consisting only of nums[0] is sequential.
Return the smallest integer x missing from nums such that x is greater than or equal to the sum of the longest sequential prefix.

Example 1:

Input: nums = [1,2,3,2,5]
Output: 6
Explanation: The longest sequential prefix of nums is [1,2,3] with a sum of 6. 6 is not in the array, therefore 6 is the smallest missing integer greater than or equal to the sum of the longest sequential prefix.

Example 2:

Input: nums = [3,4,5,1,12,14,13]
Output: 15
Explanation: The longest sequential prefix of nums is [3,4,5] with a sum of 12. 12, 13, and 14 belong to the array while 15 does not. Therefore 15 is the smallest missing integer greater than or equal to the sum of the longest sequential prefix.

Constraints:

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

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

```

my_solution = Solution()

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

test_input = { "nums": [3,4,5,1,12,14,13] }
assert my_solution.missingInteger(**test_input) == 15

test_input = { "nums": [29,30,31,32,33,34,35,36,37] }
assert my_solution.missingInteger(**test_input) == 297

test_input = { "nums": [19,20,21,22] }
assert my_solution.missingInteger(**test_input) == 82

test_input = { "nums": [18,19,20,21,22,23,24,25,26,27,28,9] }
assert my_solution.missingInteger(**test_input) == 253

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

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

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

test_input = { "nums": [11,12,13] }
assert my_solution.missingInteger(**test_input) == 36

test_input = { "nums": [47,48,49,5,3] }
assert my_solution.missingInteger(**test_input) == 144

test_input = { "nums": [23,24,25,4,5,1] }
assert my_solution.missingInteger(**test_input) == 72

test_input = { "nums": [8,9,10,10,7,8] }
assert my_solution.missingInteger(**test_input) == 27

test_input = { "nums": [31,32,33,34,10,8,7,9,7,9,9,5,10,1] }
assert my_solution.missingInteger(**test_input) == 130

test_input = { "nums": [17,18,19,20,21,22,3,7,10,10] }
assert my_solution.missingInteger(**test_input) == 117

test_input = { "nums": [6,7,8,9,10,8,6,7,4,1] }
assert my_solution.missingInteger(**test_input) == 40

test_input = { "nums": [46,8,2,4,1,4,10,2,4,10,2,5,7,3,1] }
assert my_solution.missingInteger(**test_input) == 47

test_input = { "nums": [37,1,2,9,5,8,5,2,9,4] }
assert my_solution.missingInteger(**test_input) == 38

test_input = { "nums": [31,32,33,34,1] }
assert my_solution.missingInteger(**test_input) == 130

test_input = { "nums": [45,46,47,48,49,10,8,1,7,4,10,10,6,6,2] }
assert my_solution.missingInteger(**test_input) == 235

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

test_input = { "nums": [32,33,34,35,36,37,38,39,40,41,42,43,44,8,6] }
assert my_solution.missingInteger(**test_input) == 494

test_input = { "nums": [24,8,9] }
assert my_solution.missingInteger(**test_input) == 25

test_input = { "nums": [47,48,49,9,3,8,1,9,2,5,4,5,9] }
assert my_solution.missingInteger(**test_input) == 144

test_input = { "nums": [4,5,6,7,8,9,4,7,10,7,2] }
assert my_solution.missingInteger(**test_input) == 39

test_input = { "nums": [28,29] }
assert my_solution.missingInteger(**test_input) == 57

test_input = { "nums": [40,41,42,3,8,2,7,1,4] }
assert my_solution.missingInteger(**test_input) == 123

test_input = { "nums": [17,18,19,20,21,22,23,24,25,26,27,9,2,5] }
assert my_solution.missingInteger(**test_input) == 242

test_input = { "nums": [43,44] }
assert my_solution.missingInteger(**test_input) == 87

test_input = { "nums": [19,20,5,3,10] }
assert my_solution.missingInteger(**test_input) == 39

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

test_input = { "nums": [14,15] }
assert my_solution.missingInteger(**test_input) == 29

test_input = { "nums": [47,48,49] }
assert my_solution.missingInteger(**test_input) == 144

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

test_input = { "nums": [39] }
assert my_solution.missingInteger(**test_input) == 40

test_input = { "nums": [11,12,13,14,15,7,5,2,10,5,6] }
assert my_solution.missingInteger(**test_input) == 65

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

test_input = { "nums": [29,30,31,32,33,34,35,36,37,38,39,40,41] }
assert my_solution.missingInteger(**test_input) == 455

test_input = { "nums": [24,25,26,27,28,29,30,31,32,33,34,35,6,4,1] }
assert my_solution.missingInteger(**test_input) == 354

test_input = { "nums": [7,8,9,10,11,12,13,14,15] }
assert my_solution.missingInteger(**test_input) == 99

test_input = { "nums": [39,40,41,42,43,44,45,8,10,4] }
assert my_solution.missingInteger(**test_input) == 294

test_input = { "nums": [36,37,6,8] }
assert my_solution.missingInteger(**test_input) == 73

test_input = { "nums": [27,28,29,30] }
assert my_solution.missingInteger(**test_input) == 114

test_input = { "nums": [34,35,5,7] }
assert my_solution.missingInteger(**test_input) == 69

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

test_input = { "nums": [36,37,38,39,8,10,7] }
assert my_solution.missingInteger(**test_input) == 150

test_input = { "nums": [28,29,6] }
assert my_solution.missingInteger(**test_input) == 57

test_input = { "nums": [14,15,16,17,18,19,20,10,9,10,9,7,3,6] }
assert my_solution.missingInteger(**test_input) == 119

test_input = { "nums": [27,28,29,5] }
assert my_solution.missingInteger(**test_input) == 84

test_input = { "nums": [42,43,44,45,46,47,48] }
assert my_solution.missingInteger(**test_input) == 315

test_input = { "nums": [2,3,4,5,6,7,8,9,10,11,1,10,5,6] }
assert my_solution.missingInteger(**test_input) == 65

test_input = { "nums": [32,33,34,35,36,37,5,8,5,3,4,2,10,3,7] }
assert my_solution.missingInteger(**test_input) == 207

test_input = { "nums": [24,25,26,27,28,29,30,31,32,33,1,3,9] }
assert my_solution.missingInteger(**test_input) == 285

test_input = { "nums": [48,49] }
assert my_solution.missingInteger(**test_input) == 97

test_input = { "nums": [46,47,6,7,1] }
assert my_solution.missingInteger(**test_input) == 93

test_input = { "nums": [32,33,34,35,36,37,38,39,40] }
assert my_solution.missingInteger(**test_input) == 324

test_input = { "nums": [40,41,42,43,44,45,6] }
assert my_solution.missingInteger(**test_input) == 255

test_input = { "nums": [5,6,7,8,9,10,11,12,13,14,15,16,17,18,9] }
assert my_solution.missingInteger(**test_input) == 161

test_input = { "nums": [39,40,41,3,4,7,10,6,2,10,1,9] }
assert my_solution.missingInteger(**test_input) == 120

test_input = { "nums": [17,18] }
assert my_solution.missingInteger(**test_input) == 35

test_input = { "nums": [41,42,43,44,45,46,5,6] }
assert my_solution.missingInteger(**test_input) == 261

test_input = { "nums": [6] }
assert my_solution.missingInteger(**test_input) == 7

test_input = { "nums": [46,47,48,49,50,7] }
assert my_solution.missingInteger(**test_input) == 240

test_input = { "nums": [17,18,19,20,21,22,23,24,25,26,4,7,5,4,4] }
assert my_solution.missingInteger(**test_input) == 215

test_input = { "nums": [40,41,42,43,44,45,46,4,6] }
assert my_solution.missingInteger(**test_input) == 301

test_input = { "nums": [13,4,2,2,3,4,1,8,3,7,7,7,1,6,3] }
assert my_solution.missingInteger(**test_input) == 14

test_input = { "nums": [4,5,6,7,8,9,10,11,12,13,14,15,16,6,8] }
assert my_solution.missingInteger(**test_input) == 130

test_input = { "nums": [12,10] }
assert my_solution.missingInteger(**test_input) == 13

test_input = { "nums": [17,18,19,20,21,5,3,7,10,5,3,7,3,5,3] }
assert my_solution.missingInteger(**test_input) == 95

test_input = { "nums": [38,39,40,41,42,43,44,45,5,7,9,9,4,1] }
assert my_solution.missingInteger(**test_input) == 332

test_input = { "nums": [32,33,34,35] }
assert my_solution.missingInteger(**test_input) == 134

test_input = { "nums": [33,34,7,3,4,4] }
assert my_solution.missingInteger(**test_input) == 67

test_input = { "nums": [33,34,35,36,37,38,39,40,41,42,43,44,45,46,47] }
assert my_solution.missingInteger(**test_input) == 600

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

test_input = { "nums": [18,19,20,21,22,23,24,25,26,6,8,2,1] }
assert my_solution.missingInteger(**test_input) == 198

test_input = { "nums": [19,20,21,7,9] }
assert my_solution.missingInteger(**test_input) == 60

test_input = { "nums": [19,20,21,10,1,8,2,1] }
assert my_solution.missingInteger(**test_input) == 60

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

test_input = { "nums": [48,10] }
assert my_solution.missingInteger(**test_input) == 49

test_input = { "nums": [20,21,22,23,24,25,5] }
assert my_solution.missingInteger(**test_input) == 135

test_input = { "nums": [40,41,42,43,3,4,10,3,7,8,9,1,5] }
assert my_solution.missingInteger(**test_input) == 166

test_input = { "nums": [21,22,23,24,25,26,27,8] }
assert my_solution.missingInteger(**test_input) == 168

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

test_input = { "nums": [9,10,11,12,13,14,15,16,17,4] }
assert my_solution.missingInteger(**test_input) == 117

test_input = { "nums": [25,26,27,28,29,6,8] }
assert my_solution.missingInteger(**test_input) == 135

test_input = { "nums": [16,17,18,19,20,21,22,23,24,25,6] }
assert my_solution.missingInteger(**test_input) == 205

test_input = { "nums": [7,8,9,10,11,12] }
assert my_solution.missingInteger(**test_input) == 57

test_input = { "nums": [32,9,2,6,4,1,4,3,5] }
assert my_solution.missingInteger(**test_input) == 33

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

test_input = { "nums": [34,35,36,37,38,39,1,9,3,3,10,7,1] }
assert my_solution.missingInteger(**test_input) == 219

test_input = { "nums": [37,7,6,4,3,1,10,8,7,2,6] }
assert my_solution.missingInteger(**test_input) == 38

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

test_input = { "nums": [25,26,27,4] }
assert my_solution.missingInteger(**test_input) == 78

test_input = { "nums": [31,32,33,8,5,3,7,2] }
assert my_solution.missingInteger(**test_input) == 96

test_input = { "nums": [38,39,40,41,42,43,44,45,1] }
assert my_solution.missingInteger(**test_input) == 332

test_input = { "nums": [35,36,3,10] }
assert my_solution.missingInteger(**test_input) == 71

test_input = { "nums": [31,32,33,34,35,7,6,1,9] }
assert my_solution.missingInteger(**test_input) == 165

test_input = { "nums": [47,48,49,2,2] }
assert my_solution.missingInteger(**test_input) == 144

test_input = { "nums": [3,4,5,6,7,8,9,10,11,10,1] }
assert my_solution.missingInteger(**test_input) == 63

test_input = { "nums": [50] }
assert my_solution.missingInteger(**test_input) == 51

test_input = { "nums": [14,15,16,17,7,10,3,10] }
assert my_solution.missingInteger(**test_input) == 62


minimum-number-of-operations-to-make-array-xor-equal-to-k

Minimum Number of Operations to Make Array XOR Equal to K

Prompt:
"""
You are given a 0-indexed integer array nums and a positive integer k.
You can apply the following operation on the array any number of times:

Choose any element of the array and flip a bit in its binary representation. Flipping a bit means changing a 0 to 1 or vice versa.

Return the minimum number of operations required to make the bitwise XOR of all elements of the final array equal to k.
Note that you can flip leading zero bits in the binary representation of elements. For example, for the number (101)2 you can flip the fourth bit and obtain (1101)2.

Example 1:

Input: nums = [2,1,3,4], k = 1
Output: 2
Explanation: We can do the following operations:
- Choose element 2 which is 3 == (011)2, we flip the first bit and we obtain (010)2 == 2. nums becomes [2,1,2,4].
- Choose element 0 which is 2 == (010)2, we flip the third bit and we obtain (110)2 = 6. nums becomes [6,1,2,4].
The XOR of elements of the final array is (6 XOR 1 XOR 2 XOR 4) == 1 == k.
It can be shown that we cannot make the XOR equal to k in less than 2 operations.

Example 2:

Input: nums = [2,0,2,0], k = 0
Output: 0
Explanation: The XOR of elements of the array is (2 XOR 0 XOR 2 XOR 0) == 0 == k. So no operation is needed.

Constraints:

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

You are given a 0-indexed integer array nums and a positive integer k.
You can apply the following operation on the array any number of times:

Choose any element of the array and flip a bit in its binary representation. Flipping a bit means changing a 0 to 1 or vice versa.

Return the minimum number of operations required to make the bitwise XOR of all elements of the final array equal to k.
Note that you can flip leading zero bits in the binary representation of elements. For example, for the number (101)2 you can flip the fourth bit and obtain (1101)2.

Example 1:

Input: nums = [2,1,3,4], k = 1
Output: 2
Explanation: We can do the following operations:
- Choose element 2 which is 3 == (011)2, we flip the first bit and we obtain (010)2 == 2. nums becomes [2,1,2,4].
- Choose element 0 which is 2 == (010)2, we flip the third bit and we obtain (110)2 = 6. nums becomes [6,1,2,4].
The XOR of elements of the final array is (6 XOR 1 XOR 2 XOR 4) == 1 == k.
It can be shown that we cannot make the XOR equal to k in less than 2 operations.

Example 2:

Input: nums = [2,0,2,0], k = 0
Output: 0
Explanation: The XOR of elements of the array is (2 XOR 0 XOR 2 XOR 0) == 0 == k. So no operation is needed.

Constraints:

1 <= nums.length <= 105
0 <= nums[i] <= 106
0 <= k <= 106

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

```

my_solution = Solution()

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

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

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

test_input = { "nums": [3,13,9,8,5,18,11,10], "k": 13 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [9,7,9,14,8,6], "k": 12 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [13,9,10,16,11,8,1], "k": 17 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [12,14], "k": 1 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [18,18], "k": 20 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [3,5,1,1], "k": 19 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [7,0,0,0], "k": 8 }
assert my_solution.minOperations(**test_input) == 4

test_input = { "nums": [13,15,19,18,2,9,18,11,0,7], "k": 6 }
assert my_solution.minOperations(**test_input) == 1

test_input = { "nums": [9,15,19,15,10,15,14,0,2,5], "k": 20 }
assert my_solution.minOperations(**test_input) == 1

test_input = { "nums": [19,4,19,6,3,19,14,4,16,12], "k": 4 }
assert my_solution.minOperations(**test_input) == 0

test_input = { "nums": [2,10,5,5,12,3,14,6,11,14], "k": 3 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [11,20], "k": 10 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [10,12,5,3,16,0], "k": 1 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [0,4,4,7,14,13], "k": 1 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [16,2,20,13,15,20,13], "k": 16 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [19,11,11,0,16,2,2,0,9], "k": 4 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [10,17,19,8,15], "k": 19 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [8,17,7,18], "k": 6 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [10,20], "k": 7 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [11,14,5,9,19,3,1], "k": 10 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [19,13,16], "k": 4 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [12,18,13,2,1,5,8,5,8,6], "k": 7 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [15], "k": 9 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [8,5,4,5,13,18], "k": 0 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [9,18], "k": 3 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [6,9,15,17,16], "k": 19 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [14,0,17], "k": 2 }
assert my_solution.minOperations(**test_input) == 4

test_input = { "nums": [12,1,14,13], "k": 4 }
assert my_solution.minOperations(**test_input) == 2

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

test_input = { "nums": [2,11,6,12,2,15,4,8,11], "k": 3 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [7,3,12,5,1,12,8], "k": 11 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [11,14,18,14,6,18,4,16,20,5], "k": 16 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [20,2,6,0,7], "k": 20 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [9,18,19,16,8,11,15], "k": 14 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [0,3,20,0,15,7,17,4], "k": 3 }
assert my_solution.minOperations(**test_input) == 2

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

test_input = { "nums": [2,7,13,16,2,2], "k": 15 }
assert my_solution.minOperations(**test_input) == 4

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

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

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

test_input = { "nums": [1,20,4,19,12,18,5,3,11,8], "k": 14 }
assert my_solution.minOperations(**test_input) == 4

test_input = { "nums": [16,12,12], "k": 20 }
assert my_solution.minOperations(**test_input) == 1

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

test_input = { "nums": [20,0,19,14,7,0], "k": 18 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [0,15,9,1,15], "k": 11 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [9,11,8,20,10], "k": 0 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [2,10,2,14,7,13,4,9,2], "k": 20 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [7,12,8], "k": 14 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [20,11,5,8,1,8,4,16], "k": 7 }
assert my_solution.minOperations(**test_input) == 1

test_input = { "nums": [8,2,19,9,8], "k": 9 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [17], "k": 8 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [19,6], "k": 13 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [12,3,20,19], "k": 4 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [4,10,18,17,20,6,4], "k": 10 }
assert my_solution.minOperations(**test_input) == 2

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

test_input = { "nums": [18,12,9,18,12,12,1], "k": 12 }
assert my_solution.minOperations(**test_input) == 1

test_input = { "nums": [14,4,0,18,18,8,4,9], "k": 17 }
assert my_solution.minOperations(**test_input) == 4

test_input = { "nums": [7,16,16,6], "k": 19 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [7,16,2,13,0,17,16], "k": 18 }
assert my_solution.minOperations(**test_input) == 3

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

test_input = { "nums": [13,14,9,19,5,13], "k": 8 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [4,15,10,15,11,1,3,5,18,13], "k": 16 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [9,7,8], "k": 11 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [7,4,6,20,9,9,6,6], "k": 10 }
assert my_solution.minOperations(**test_input) == 4

test_input = { "nums": [1,9,13,19,19,0,16,20,4], "k": 2 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [20,3,9,6,5,8], "k": 20 }
assert my_solution.minOperations(**test_input) == 1

test_input = { "nums": [11,20,5,16,15,11,8], "k": 11 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [12,10,16,18,17,4,2,19,17,2], "k": 19 }
assert my_solution.minOperations(**test_input) == 0

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

test_input = { "nums": [13,3,10,2,9,13,5,11,5], "k": 20 }
assert my_solution.minOperations(**test_input) == 4

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

test_input = { "nums": [3,19,0,18,6], "k": 15 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [12,6], "k": 18 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [10,11,12,6,10,1,15], "k": 8 }
assert my_solution.minOperations(**test_input) == 3

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

test_input = { "nums": [11,5,9], "k": 2 }
assert my_solution.minOperations(**test_input) == 2

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

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

test_input = { "nums": [9], "k": 16 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [9,5,7,11,8,18,5,1,4], "k": 8 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [1,8,7,19,3,20,13,9,10], "k": 1 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [19,18,6], "k": 8 }
assert my_solution.minOperations(**test_input) == 4

test_input = { "nums": [19,12,3,18,12,19,5,20], "k": 0 }
assert my_solution.minOperations(**test_input) == 0

test_input = { "nums": [6,18,12,9,20], "k": 13 }
assert my_solution.minOperations(**test_input) == 1

test_input = { "nums": [19,5,5,7,4,7,15], "k": 7 }
assert my_solution.minOperations(**test_input) == 5

test_input = { "nums": [17,7,19], "k": 18 }
assert my_solution.minOperations(**test_input) == 4

test_input = { "nums": [14,13,3,15,18,20,2,9,3], "k": 14 }
assert my_solution.minOperations(**test_input) == 4

test_input = { "nums": [16,10,3,2,3,19], "k": 4 }
assert my_solution.minOperations(**test_input) == 4

test_input = { "nums": [2,0,8], "k": 18 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [19,5,5,12,20,2,10,17], "k": 12 }
assert my_solution.minOperations(**test_input) == 4

test_input = { "nums": [6,0,0,1,15,9,19,12], "k": 6 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [8,16,13,8,18,9,16,16,19,11], "k": 12 }
assert my_solution.minOperations(**test_input) == 2

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

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

test_input = { "nums": [14,10,16,9,6,13,11,13,11,16], "k": 20 }
assert my_solution.minOperations(**test_input) == 5

test_input = { "nums": [13,19,0,12,11,10,11,2,6], "k": 7 }
assert my_solution.minOperations(**test_input) == 4

test_input = { "nums": [6,1,4,9,1,7,11,15,15,0], "k": 8 }
assert my_solution.minOperations(**test_input) == 4


minimum-number-of-operations-to-make-x-and-y-equal

Minimum Number of Operations to Make X and Y Equal

Prompt:
"""
You are given two positive integers x and y.
In one operation, you can do one of the four following operations:

Divide x by 11 if x is a multiple of 11.
Divide x by 5 if x is a multiple of 5.
Decrement x by 1.
Increment x by 1.

Return the minimum number of operations required to make  x and y equal.

Example 1:

Input: x = 26, y = 1
Output: 3
Explanation: We can make 26 equal to 1 by applying the following operations:
1. Decrement x by 1
2. Divide x by 5
3. Divide x by 5
It can be shown that 3 is the minimum number of operations required to make 26 equal to 1.

Example 2:

Input: x = 54, y = 2
Output: 4
Explanation: We can make 54 equal to 2 by applying the following operations:
1. Increment x by 1
2. Divide x by 11
3. Divide x by 5
4. Increment x by 1
It can be shown that 4 is the minimum number of operations required to make 54 equal to 2.

Example 3:

Input: x = 25, y = 30
Output: 5
Explanation: We can make 25 equal to 30 by applying the following operations:
1. Increment x by 1
2. Increment x by 1
3. Increment x by 1
4. Increment x by 1
5. Increment x by 1
It can be shown that 5 is the minimum number of operations required to make 25 equal to 30.

Constraints:

1 <= x, y <= 104
"""
class Solution:
    def minimumOperationsToMakeEqual(self, x: int, y: int) -> int:

You are given two positive integers x and y.
In one operation, you can do one of the four following operations:

Divide x by 11 if x is a multiple of 11.
Divide x by 5 if x is a multiple of 5.
Decrement x by 1.
Increment x by 1.

Return the minimum number of operations required to make  x and y equal.

Example 1:

Input: x = 26, y = 1
Output: 3
Explanation: We can make 26 equal to 1 by applying the following operations:
1. Decrement x by 1
2. Divide x by 5
3. Divide x by 5
It can be shown that 3 is the minimum number of operations required to make 26 equal to 1.

Example 2:

Input: x = 54, y = 2
Output: 4
Explanation: We can make 54 equal to 2 by applying the following operations:
1. Increment x by 1
2. Divide x by 11
3. Divide x by 5
4. Increment x by 1
It can be shown that 4 is the minimum number of operations required to make 54 equal to 2.

Example 3:

Input: x = 25, y = 30
Output: 5
Explanation: We can make 25 equal to 30 by applying the following operations:
1. Increment x by 1
2. Increment x by 1
3. Increment x by 1
4. Increment x by 1
5. Increment x by 1
It can be shown that 5 is the minimum number of operations required to make 25 equal to 30.

Constraints:

1 <= x, y <= 104

Please complete the code below to solve above prblem:
```python
class Solution:
    def minimumOperationsToMakeEqual(self, x: int, y: int) -> int:

```

my_solution = Solution()

test_input = { "x": 26, "y": 1 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 3

test_input = { "x": 54, "y": 2 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 4

test_input = { "x": 25, "y": 30 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 5

test_input = { "x": 1, "y": 1 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 0

test_input = { "x": 1, "y": 2 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 1

test_input = { "x": 1, "y": 3 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 2

test_input = { "x": 1, "y": 4 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 3

test_input = { "x": 1, "y": 5 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 4

test_input = { "x": 1, "y": 6 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 5

test_input = { "x": 1, "y": 7 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 6

test_input = { "x": 1, "y": 8 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 7

test_input = { "x": 1, "y": 9 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 8

test_input = { "x": 1, "y": 10 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 9

test_input = { "x": 1, "y": 11 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 10

test_input = { "x": 1, "y": 12 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 11

test_input = { "x": 1, "y": 13 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 12

test_input = { "x": 1, "y": 14 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 13

test_input = { "x": 1, "y": 15 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 14

test_input = { "x": 1, "y": 16 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 15

test_input = { "x": 1, "y": 17 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 16

test_input = { "x": 1, "y": 18 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 17

test_input = { "x": 1, "y": 19 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 18

test_input = { "x": 1, "y": 20 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 19

test_input = { "x": 1, "y": 21 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 20

test_input = { "x": 1, "y": 22 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 21

test_input = { "x": 1, "y": 23 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 22

test_input = { "x": 1, "y": 24 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 23

test_input = { "x": 1, "y": 25 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 24

test_input = { "x": 2, "y": 1 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 1

test_input = { "x": 2, "y": 2 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 0

test_input = { "x": 2, "y": 3 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 1

test_input = { "x": 2, "y": 4 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 2

test_input = { "x": 2, "y": 5 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 3

test_input = { "x": 2, "y": 6 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 4

test_input = { "x": 2, "y": 7 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 5

test_input = { "x": 2, "y": 8 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 6

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

test_input = { "x": 2, "y": 10 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 8

test_input = { "x": 2, "y": 11 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 9

test_input = { "x": 2, "y": 12 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 10

test_input = { "x": 2, "y": 13 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 11

test_input = { "x": 2, "y": 14 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 12

test_input = { "x": 2, "y": 15 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 13

test_input = { "x": 2, "y": 16 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 14

test_input = { "x": 2, "y": 17 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 15

test_input = { "x": 2, "y": 18 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 16

test_input = { "x": 2, "y": 19 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 17

test_input = { "x": 2, "y": 20 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 18

test_input = { "x": 2, "y": 21 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 19

test_input = { "x": 2, "y": 22 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 20

test_input = { "x": 2, "y": 23 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 21

test_input = { "x": 2, "y": 24 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 22

test_input = { "x": 2, "y": 25 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 23

test_input = { "x": 3, "y": 1 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 2

test_input = { "x": 3, "y": 2 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 1

test_input = { "x": 3, "y": 3 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 0

test_input = { "x": 3, "y": 4 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 1

test_input = { "x": 3, "y": 5 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 2

test_input = { "x": 3, "y": 6 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 3

test_input = { "x": 3, "y": 7 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 4

test_input = { "x": 3, "y": 8 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 5

test_input = { "x": 3, "y": 9 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 6

test_input = { "x": 3, "y": 10 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 7

test_input = { "x": 3, "y": 11 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 8

test_input = { "x": 3, "y": 12 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 9

test_input = { "x": 3, "y": 13 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 10

test_input = { "x": 3, "y": 14 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 11

test_input = { "x": 3, "y": 15 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 12

test_input = { "x": 3, "y": 16 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 13

test_input = { "x": 3, "y": 17 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 14

test_input = { "x": 3, "y": 18 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 15

test_input = { "x": 3, "y": 19 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 16

test_input = { "x": 3, "y": 20 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 17

test_input = { "x": 3, "y": 21 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 18

test_input = { "x": 3, "y": 22 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 19

test_input = { "x": 3, "y": 23 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 20

test_input = { "x": 3, "y": 24 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 21

test_input = { "x": 3, "y": 25 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 22

test_input = { "x": 4, "y": 1 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 2

test_input = { "x": 4, "y": 2 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 2

test_input = { "x": 4, "y": 3 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 1

test_input = { "x": 4, "y": 4 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 0

test_input = { "x": 4, "y": 5 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 1

test_input = { "x": 4, "y": 6 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 2

test_input = { "x": 4, "y": 7 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 3

test_input = { "x": 4, "y": 8 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 4

test_input = { "x": 4, "y": 9 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 5

test_input = { "x": 4, "y": 10 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 6

test_input = { "x": 4, "y": 11 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 7

test_input = { "x": 4, "y": 12 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 8

test_input = { "x": 4, "y": 13 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 9

test_input = { "x": 4, "y": 14 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 10

test_input = { "x": 4, "y": 15 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 11

test_input = { "x": 4, "y": 16 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 12

test_input = { "x": 4, "y": 17 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 13

test_input = { "x": 4, "y": 18 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 14

test_input = { "x": 4, "y": 19 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 15

test_input = { "x": 4, "y": 20 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 16

test_input = { "x": 4, "y": 21 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 17

test_input = { "x": 4, "y": 22 }
assert my_solution.minimumOperationsToMakeEqual(**test_input) == 18