furthest-point-from-origin

Furthest Point From Origin

Prompt:
"""
You are given a string moves of length n consisting only of characters 'L', 'R', and '_'. The string represents your movement on a number line starting from the origin 0.

In the ith move, you can choose one of the following directions:

 * move to the left if moves[i] = 'L' or moves[i] = '_'
 * move to the right if moves[i] = 'R' or moves[i] = '_'

Return the distance from the origin of the furthest point you can get to after n moves.

Example 1:

Input: moves = "L_RL__R"
Output: 3
Explanation: The furthest point we can reach from the origin 0 is point -3 through the following sequence of moves "LLRLLLR".

Example 2:

Input: moves = "_R__LL_"
Output: 5
Explanation: The furthest point we can reach from the origin 0 is point -5 through the following sequence of moves "LRLLLLL".

Example 3:

Input: moves = "_______"
Output: 7
Explanation: The furthest point we can reach from the origin 0 is point 7 through the following sequence of moves "RRRRRRR".

Constraints:

 * 1 <= moves.length == n <= 50
 * moves consists only of characters 'L', 'R' and '_'.
"""
class Solution:
    def furthestDistanceFromOrigin(self, moves: str) -> int:

You are given a string moves of length n consisting only of characters 'L', 'R', and '_'. The string represents your movement on a number line starting from the origin 0.

In the ith move, you can choose one of the following directions:

 * move to the left if moves[i] = 'L' or moves[i] = '_'
 * move to the right if moves[i] = 'R' or moves[i] = '_'

Return the distance from the origin of the furthest point you can get to after n moves.

Example 1:

Input: moves = "L_RL__R"
Output: 3
Explanation: The furthest point we can reach from the origin 0 is point -3 through the following sequence of moves "LLRLLLR".

Example 2:

Input: moves = "_R__LL_"
Output: 5
Explanation: The furthest point we can reach from the origin 0 is point -5 through the following sequence of moves "LRLLLLL".

Example 3:

Input: moves = "_______"
Output: 7
Explanation: The furthest point we can reach from the origin 0 is point 7 through the following sequence of moves "RRRRRRR".

Constraints:

 * 1 <= moves.length == n <= 50
 * moves consists only of characters 'L', 'R' and '_'.

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

```

my_solution = Solution()

test_input = { "moves": "L_RL__R" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 3

test_input = { "moves": "_R__LL_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 5

test_input = { "moves": "_______" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 7

test_input = { "moves": "L" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 1

test_input = { "moves": "R" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 1

test_input = { "moves": "_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 1

test_input = { "moves": "LL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "LR" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 0

test_input = { "moves": "L_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "RL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 0

test_input = { "moves": "RR" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "R_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "_L" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "_R" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "__" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "LLL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 3

test_input = { "moves": "LLR" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 1

test_input = { "moves": "LL_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 3

test_input = { "moves": "LRL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 1

test_input = { "moves": "LRR" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 1

test_input = { "moves": "LR_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 1

test_input = { "moves": "L_L" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 3

test_input = { "moves": "L_R" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 1

test_input = { "moves": "L__" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 3

test_input = { "moves": "RLL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 1

test_input = { "moves": "RLR" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 1

test_input = { "moves": "RL_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 1

test_input = { "moves": "RRL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 1

test_input = { "moves": "RRR" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 3

test_input = { "moves": "RR_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 3

test_input = { "moves": "R_L" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 1

test_input = { "moves": "R_R" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 3

test_input = { "moves": "R__" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 3

test_input = { "moves": "_LL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 3

test_input = { "moves": "_LR" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 1

test_input = { "moves": "_L_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 3

test_input = { "moves": "_RL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 1

test_input = { "moves": "_RR" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 3

test_input = { "moves": "_R_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 3

test_input = { "moves": "__L" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 3

test_input = { "moves": "__R" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 3

test_input = { "moves": "___" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 3

test_input = { "moves": "LLLL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 4

test_input = { "moves": "LLLR" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "LLL_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 4

test_input = { "moves": "LLRL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "LLRR" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 0

test_input = { "moves": "LLR_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "LL_L" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 4

test_input = { "moves": "LL_R" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "LL__" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 4

test_input = { "moves": "LRLL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "LRLR" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 0

test_input = { "moves": "LRL_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "LRRL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 0

test_input = { "moves": "LRRR" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "LRR_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "LR_L" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "LR_R" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "LR__" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "L_LL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 4

test_input = { "moves": "L_LR" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "L_L_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 4

test_input = { "moves": "L_RL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "L_RR" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "L_R_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "L__L" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 4

test_input = { "moves": "L__R" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "L___" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 4

test_input = { "moves": "RLLL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "RLLR" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 0

test_input = { "moves": "RLL_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "RLRL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 0

test_input = { "moves": "RLRR" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "RLR_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "RL_L" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "RL_R" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "RL__" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "RRLL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 0

test_input = { "moves": "RRLR" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "RRL_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "RRRL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "RRRR" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 4

test_input = { "moves": "RRR_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 4

test_input = { "moves": "RR_L" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "RR_R" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 4

test_input = { "moves": "RR__" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 4

test_input = { "moves": "R_LL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "R_LR" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "R_L_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "R_RL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "R_RR" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 4

test_input = { "moves": "R_R_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 4

test_input = { "moves": "R__L" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "R__R" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 4

test_input = { "moves": "R___" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 4

test_input = { "moves": "_LLL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 4

test_input = { "moves": "_LLR" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2

test_input = { "moves": "_LL_" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 4

test_input = { "moves": "_LRL" }
assert my_solution.furthestDistanceFromOrigin(**test_input) == 2


find-the-minimum-possible-sum-of-a-beautiful-array

Find the Minimum Possible Sum of a Beautiful Array

Prompt:
"""
You are given positive integers n and target.

An array nums is beautiful if it meets the following conditions:

 * nums.length == n.
 * nums consists of pairwise distinct positive integers.
 * There doesn't exist two distinct indices, i and j, in the range [0, n - 1], such that nums[i] + nums[j] == target.

Return the minimum possible sum that a beautiful array could have modulo 109 + 7.

Example 1:

Input: n = 2, target = 3
Output: 4
Explanation: We can see that nums = [1,3] is beautiful.
- The array nums has length n = 2.
- The array nums consists of pairwise distinct positive integers.
- There doesn't exist two distinct indices, i and j, with nums[i] + nums[j] == 3.
It can be proven that 4 is the minimum possible sum that a beautiful array could have.

Example 2:

Input: n = 3, target = 3
Output: 8
Explanation: We can see that nums = [1,3,4] is beautiful.
- The array nums has length n = 3.
- The array nums consists of pairwise distinct positive integers.
- There doesn't exist two distinct indices, i and j, with nums[i] + nums[j] == 3.
It can be proven that 8 is the minimum possible sum that a beautiful array could have.

Example 3:

Input: n = 1, target = 1
Output: 1
Explanation: We can see, that nums = [1] is beautiful.

Constraints:

 * 1 <= n <= 109
 * 1 <= target <= 109
"""
class Solution:
    def minimumPossibleSum(self, n: int, target: int) -> int:

You are given positive integers n and target.

An array nums is beautiful if it meets the following conditions:

 * nums.length == n.
 * nums consists of pairwise distinct positive integers.
 * There doesn't exist two distinct indices, i and j, in the range [0, n - 1], such that nums[i] + nums[j] == target.

Return the minimum possible sum that a beautiful array could have modulo 109 + 7.

Example 1:

Input: n = 2, target = 3
Output: 4
Explanation: We can see that nums = [1,3] is beautiful.
- The array nums has length n = 2.
- The array nums consists of pairwise distinct positive integers.
- There doesn't exist two distinct indices, i and j, with nums[i] + nums[j] == 3.
It can be proven that 4 is the minimum possible sum that a beautiful array could have.

Example 2:

Input: n = 3, target = 3
Output: 8
Explanation: We can see that nums = [1,3,4] is beautiful.
- The array nums has length n = 3.
- The array nums consists of pairwise distinct positive integers.
- There doesn't exist two distinct indices, i and j, with nums[i] + nums[j] == 3.
It can be proven that 8 is the minimum possible sum that a beautiful array could have.

Example 3:

Input: n = 1, target = 1
Output: 1
Explanation: We can see, that nums = [1] is beautiful.

Constraints:

 * 1 <= n <= 109
 * 1 <= target <= 109

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

```

my_solution = Solution()

test_input = { "n": 2, "target": 3 }
assert my_solution.minimumPossibleSum(**test_input) == 4

test_input = { "n": 3, "target": 3 }
assert my_solution.minimumPossibleSum(**test_input) == 8

test_input = { "n": 1, "target": 1 }
assert my_solution.minimumPossibleSum(**test_input) == 1

test_input = { "n": 16, "target": 6 }
assert my_solution.minimumPossibleSum(**test_input) == 162

test_input = { "n": 16, "target": 32 }
assert my_solution.minimumPossibleSum(**test_input) == 136

test_input = { "n": 13, "target": 50 }
assert my_solution.minimumPossibleSum(**test_input) == 91

test_input = { "n": 36, "target": 21 }
assert my_solution.minimumPossibleSum(**test_input) == 926

test_input = { "n": 40, "target": 17 }
assert my_solution.minimumPossibleSum(**test_input) == 1076

test_input = { "n": 37, "target": 46 }
assert my_solution.minimumPossibleSum(**test_input) == 1011

test_input = { "n": 33, "target": 7 }
assert my_solution.minimumPossibleSum(**test_input) == 651

test_input = { "n": 42, "target": 46 }
assert my_solution.minimumPossibleSum(**test_input) == 1321

test_input = { "n": 46, "target": 29 }
assert my_solution.minimumPossibleSum(**test_input) == 1529

test_input = { "n": 9, "target": 43 }
assert my_solution.minimumPossibleSum(**test_input) == 45

test_input = { "n": 30, "target": 31 }
assert my_solution.minimumPossibleSum(**test_input) == 690

test_input = { "n": 14, "target": 47 }
assert my_solution.minimumPossibleSum(**test_input) == 105

test_input = { "n": 5, "target": 3 }
assert my_solution.minimumPossibleSum(**test_input) == 19

test_input = { "n": 41, "target": 23 }
assert my_solution.minimumPossibleSum(**test_input) == 1191

test_input = { "n": 17, "target": 13 }
assert my_solution.minimumPossibleSum(**test_input) == 219

test_input = { "n": 9, "target": 13 }
assert my_solution.minimumPossibleSum(**test_input) == 63

test_input = { "n": 29, "target": 18 }
assert my_solution.minimumPossibleSum(**test_input) == 595

test_input = { "n": 21, "target": 14 }
assert my_solution.minimumPossibleSum(**test_input) == 315

test_input = { "n": 4, "target": 6 }
assert my_solution.minimumPossibleSum(**test_input) == 12

test_input = { "n": 38, "target": 15 }
assert my_solution.minimumPossibleSum(**test_input) == 958

test_input = { "n": 14, "target": 7 }
assert my_solution.minimumPossibleSum(**test_input) == 138

test_input = { "n": 18, "target": 26 }
assert my_solution.minimumPossibleSum(**test_input) == 231

test_input = { "n": 11, "target": 15 }
assert my_solution.minimumPossibleSum(**test_input) == 94

test_input = { "n": 7, "target": 8 }
assert my_solution.minimumPossibleSum(**test_input) == 37

test_input = { "n": 11, "target": 22 }
assert my_solution.minimumPossibleSum(**test_input) == 66

test_input = { "n": 36, "target": 11 }
assert my_solution.minimumPossibleSum(**test_input) == 821

test_input = { "n": 18, "target": 29 }
assert my_solution.minimumPossibleSum(**test_input) == 227

test_input = { "n": 26, "target": 17 }
assert my_solution.minimumPossibleSum(**test_input) == 495

test_input = { "n": 37, "target": 13 }
assert my_solution.minimumPossibleSum(**test_input) == 889

test_input = { "n": 46, "target": 38 }
assert my_solution.minimumPossibleSum(**test_input) == 1567

test_input = { "n": 13, "target": 7 }
assert my_solution.minimumPossibleSum(**test_input) == 121

test_input = { "n": 33, "target": 34 }
assert my_solution.minimumPossibleSum(**test_input) == 817

test_input = { "n": 39, "target": 12 }
assert my_solution.minimumPossibleSum(**test_input) == 945

test_input = { "n": 1, "target": 45 }
assert my_solution.minimumPossibleSum(**test_input) == 1

test_input = { "n": 37, "target": 36 }
assert my_solution.minimumPossibleSum(**test_input) == 1026

test_input = { "n": 16, "target": 19 }
assert my_solution.minimumPossibleSum(**test_input) == 199

test_input = { "n": 22, "target": 15 }
assert my_solution.minimumPossibleSum(**test_input) == 358

test_input = { "n": 34, "target": 42 }
assert my_solution.minimumPossibleSum(**test_input) == 855

test_input = { "n": 50, "target": 22 }
assert my_solution.minimumPossibleSum(**test_input) == 1665

test_input = { "n": 42, "target": 44 }
assert my_solution.minimumPossibleSum(**test_input) == 1323

test_input = { "n": 40, "target": 8 }
assert my_solution.minimumPossibleSum(**test_input) == 928

test_input = { "n": 7, "target": 19 }
assert my_solution.minimumPossibleSum(**test_input) == 28

test_input = { "n": 44, "target": 10 }
assert my_solution.minimumPossibleSum(**test_input) == 1146

test_input = { "n": 21, "target": 6 }
assert my_solution.minimumPossibleSum(**test_input) == 267

test_input = { "n": 27, "target": 26 }
assert my_solution.minimumPossibleSum(**test_input) == 546

test_input = { "n": 49, "target": 4 }
assert my_solution.minimumPossibleSum(**test_input) == 1272

test_input = { "n": 35, "target": 2 }
assert my_solution.minimumPossibleSum(**test_input) == 630

test_input = { "n": 32, "target": 29 }
assert my_solution.minimumPossibleSum(**test_input) == 780

test_input = { "n": 20, "target": 41 }
assert my_solution.minimumPossibleSum(**test_input) == 210

test_input = { "n": 30, "target": 48 }
assert my_solution.minimumPossibleSum(**test_input) == 603

test_input = { "n": 12, "target": 34 }
assert my_solution.minimumPossibleSum(**test_input) == 78

test_input = { "n": 50, "target": 44 }
assert my_solution.minimumPossibleSum(**test_input) == 1863

test_input = { "n": 42, "target": 26 }
assert my_solution.minimumPossibleSum(**test_input) == 1251

test_input = { "n": 3, "target": 18 }
assert my_solution.minimumPossibleSum(**test_input) == 6

test_input = { "n": 11, "target": 3 }
assert my_solution.minimumPossibleSum(**test_input) == 76

test_input = { "n": 38, "target": 29 }
assert my_solution.minimumPossibleSum(**test_input) == 1077

test_input = { "n": 17, "target": 24 }
assert my_solution.minimumPossibleSum(**test_input) == 208

test_input = { "n": 50, "target": 31 }
assert my_solution.minimumPossibleSum(**test_input) == 1800

test_input = { "n": 32, "target": 41 }
assert my_solution.minimumPossibleSum(**test_input) == 768

test_input = { "n": 12, "target": 24 }
assert my_solution.minimumPossibleSum(**test_input) == 78

test_input = { "n": 35, "target": 43 }
assert my_solution.minimumPossibleSum(**test_input) == 924

test_input = { "n": 9, "target": 47 }
assert my_solution.minimumPossibleSum(**test_input) == 45

test_input = { "n": 32, "target": 26 }
assert my_solution.minimumPossibleSum(**test_input) == 756

test_input = { "n": 6, "target": 42 }
assert my_solution.minimumPossibleSum(**test_input) == 21

test_input = { "n": 11, "target": 1 }
assert my_solution.minimumPossibleSum(**test_input) == 66

test_input = { "n": 11, "target": 24 }
assert my_solution.minimumPossibleSum(**test_input) == 66

test_input = { "n": 39, "target": 38 }
assert my_solution.minimumPossibleSum(**test_input) == 1140

test_input = { "n": 18, "target": 8 }
assert my_solution.minimumPossibleSum(**test_input) == 213

test_input = { "n": 29, "target": 5 }
assert my_solution.minimumPossibleSum(**test_input) == 489

test_input = { "n": 44, "target": 6 }
assert my_solution.minimumPossibleSum(**test_input) == 1072

test_input = { "n": 29, "target": 30 }
assert my_solution.minimumPossibleSum(**test_input) == 631

test_input = { "n": 13, "target": 47 }
assert my_solution.minimumPossibleSum(**test_input) == 91

test_input = { "n": 46, "target": 21 }
assert my_solution.minimumPossibleSum(**test_input) == 1441

test_input = { "n": 46, "target": 6 }
assert my_solution.minimumPossibleSum(**test_input) == 1167

test_input = { "n": 27, "target": 30 }
assert my_solution.minimumPossibleSum(**test_input) == 546

test_input = { "n": 5, "target": 35 }
assert my_solution.minimumPossibleSum(**test_input) == 15

test_input = { "n": 12, "target": 32 }
assert my_solution.minimumPossibleSum(**test_input) == 78

test_input = { "n": 13, "target": 39 }
assert my_solution.minimumPossibleSum(**test_input) == 91

test_input = { "n": 10, "target": 11 }
assert my_solution.minimumPossibleSum(**test_input) == 80

test_input = { "n": 46, "target": 14 }
assert my_solution.minimumPossibleSum(**test_input) == 1315

test_input = { "n": 37, "target": 18 }
assert my_solution.minimumPossibleSum(**test_input) == 927

test_input = { "n": 32, "target": 8 }
assert my_solution.minimumPossibleSum(**test_input) == 612

test_input = { "n": 26, "target": 14 }
assert my_solution.minimumPossibleSum(**test_input) == 465

test_input = { "n": 33, "target": 41 }
assert my_solution.minimumPossibleSum(**test_input) == 821

test_input = { "n": 44, "target": 39 }
assert my_solution.minimumPossibleSum(**test_input) == 1465

test_input = { "n": 3, "target": 21 }
assert my_solution.minimumPossibleSum(**test_input) == 6

test_input = { "n": 9, "target": 11 }
assert my_solution.minimumPossibleSum(**test_input) == 65

test_input = { "n": 16, "target": 43 }
assert my_solution.minimumPossibleSum(**test_input) == 136

test_input = { "n": 7, "target": 22 }
assert my_solution.minimumPossibleSum(**test_input) == 28

test_input = { "n": 21, "target": 49 }
assert my_solution.minimumPossibleSum(**test_input) == 231

test_input = { "n": 23, "target": 16 }
assert my_solution.minimumPossibleSum(**test_input) == 381

test_input = { "n": 33, "target": 32 }
assert my_solution.minimumPossibleSum(**test_input) == 816

test_input = { "n": 22, "target": 1 }
assert my_solution.minimumPossibleSum(**test_input) == 253

test_input = { "n": 5, "target": 47 }
assert my_solution.minimumPossibleSum(**test_input) == 15

test_input = { "n": 38, "target": 7 }
assert my_solution.minimumPossibleSum(**test_input) == 846

test_input = { "n": 38, "target": 24 }
assert my_solution.minimumPossibleSum(**test_input) == 1027

test_input = { "n": 13, "target": 36 }
assert my_solution.minimumPossibleSum(**test_input) == 91


minimum-operations-to-form-subsequence-with-target-sum

Minimum Operations to Form Subsequence With Target Sum

Prompt:
"""
You are given a 0-indexed array nums consisting of non-negative powers of 2, and an integer target.

In one operation, you must apply the following changes to the array:

 * Choose any element of the array nums[i] such that nums[i] > 1.
 * Remove nums[i] from the array.
 * Add two occurrences of nums[i] / 2 to the end of nums.

Return the minimum number of operations you need to perform so that nums contains a subsequence whose elements sum to target. If it is impossible to obtain such a subsequence, return -1.

A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.

Example 1:

Input: nums = [1,2,8], target = 7
Output: 1
Explanation: In the first operation, we choose element nums[2]. The array becomes equal to nums = [1,2,4,4].
At this stage, nums contains the subsequence [1,2,4] which sums up to 7.
It can be shown that there is no shorter sequence of operations that results in a subsequnce that sums up to 7.

Example 2:

Input: nums = [1,32,1,2], target = 12
Output: 2
Explanation: In the first operation, we choose element nums[1]. The array becomes equal to nums = [1,1,2,16,16].
In the second operation, we choose element nums[3]. The array becomes equal to nums = [1,1,2,16,8,8]
At this stage, nums contains the subsequence [1,1,2,8] which sums up to 12.
It can be shown that there is no shorter sequence of operations that results in a subsequence that sums up to 12.

Example 3:

Input: nums = [1,32,1], target = 35
Output: -1
Explanation: It can be shown that no sequence of operations results in a subsequence that sums up to 35.

Constraints:

 * 1 <= nums.length <= 1000
 * 1 <= nums[i] <= 230
 * nums consists only of non-negative powers of two.
 * 1 <= target < 231
"""
class Solution:
    def minOperations(self, nums: List[int], target: int) -> int:

You are given a 0-indexed array nums consisting of non-negative powers of 2, and an integer target.

In one operation, you must apply the following changes to the array:

 * Choose any element of the array nums[i] such that nums[i] > 1.
 * Remove nums[i] from the array.
 * Add two occurrences of nums[i] / 2 to the end of nums.

Return the minimum number of operations you need to perform so that nums contains a subsequence whose elements sum to target. If it is impossible to obtain such a subsequence, return -1.

A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements.

Example 1:

Input: nums = [1,2,8], target = 7
Output: 1
Explanation: In the first operation, we choose element nums[2]. The array becomes equal to nums = [1,2,4,4].
At this stage, nums contains the subsequence [1,2,4] which sums up to 7.
It can be shown that there is no shorter sequence of operations that results in a subsequnce that sums up to 7.

Example 2:

Input: nums = [1,32,1,2], target = 12
Output: 2
Explanation: In the first operation, we choose element nums[1]. The array becomes equal to nums = [1,1,2,16,16].
In the second operation, we choose element nums[3]. The array becomes equal to nums = [1,1,2,16,8,8]
At this stage, nums contains the subsequence [1,1,2,8] which sums up to 12.
It can be shown that there is no shorter sequence of operations that results in a subsequence that sums up to 12.

Example 3:

Input: nums = [1,32,1], target = 35
Output: -1
Explanation: It can be shown that no sequence of operations results in a subsequence that sums up to 35.

Constraints:

 * 1 <= nums.length <= 1000
 * 1 <= nums[i] <= 230
 * nums consists only of non-negative powers of two.
 * 1 <= target < 231

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

```

my_solution = Solution()

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

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

test_input = { "nums": [1,32,1], "target": 35 }
assert my_solution.minOperations(**test_input) == -1

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

test_input = { "nums": [16,128,32], "target": 1 }
assert my_solution.minOperations(**test_input) == 4

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

test_input = { "nums": [64,128,128], "target": 2 }
assert my_solution.minOperations(**test_input) == 5

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

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

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

test_input = { "nums": [1,256,16,128], "target": 3 }
assert my_solution.minOperations(**test_input) == 3

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

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

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

test_input = { "nums": [128,1,128,1,64], "target": 4 }
assert my_solution.minOperations(**test_input) == 4

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

test_input = { "nums": [8,2,64,32], "target": 4 }
assert my_solution.minOperations(**test_input) == 1

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

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

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

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

test_input = { "nums": [128,32,16], "target": 4 }
assert my_solution.minOperations(**test_input) == 2

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

test_input = { "nums": [128,32,256], "target": 4 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [1,1,1,1,1], "target": 5 }
assert my_solution.minOperations(**test_input) == 0

test_input = { "nums": [1,1,128,256,1,16], "target": 5 }
assert my_solution.minOperations(**test_input) == 2

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

test_input = { "nums": [32,1,8,1,64], "target": 5 }
assert my_solution.minOperations(**test_input) == 1

test_input = { "nums": [128,256,32,1,1,1], "target": 5 }
assert my_solution.minOperations(**test_input) == 3

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

test_input = { "nums": [16,16,1,1,128], "target": 5 }
assert my_solution.minOperations(**test_input) == 2

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

test_input = { "nums": [64,32,2,8], "target": 5 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [1,4], "target": 5 }
assert my_solution.minOperations(**test_input) == 0

test_input = { "nums": [8,64,128], "target": 5 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [1,1,1,1,1,1], "target": 6 }
assert my_solution.minOperations(**test_input) == 0

test_input = { "nums": [128,1,256,1,1,1,32], "target": 6 }
assert my_solution.minOperations(**test_input) == 3

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

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

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

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

test_input = { "nums": [64,1,16,1,1,64], "target": 6 }
assert my_solution.minOperations(**test_input) == 2

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

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

test_input = { "nums": [4,1,1], "target": 6 }
assert my_solution.minOperations(**test_input) == 0

test_input = { "nums": [16,64,4,128], "target": 6 }
assert my_solution.minOperations(**test_input) == 3

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

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

test_input = { "nums": [64,128,1,32,1,2], "target": 6 }
assert my_solution.minOperations(**test_input) == 3

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

test_input = { "nums": [1,128,1,256,32,1], "target": 6 }
assert my_solution.minOperations(**test_input) == 3

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

test_input = { "nums": [256,2,32,32,1], "target": 6 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [1,16,1,1,1,16,256], "target": 6 }
assert my_solution.minOperations(**test_input) == 2

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

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

test_input = { "nums": [1,16,128,1,1,32,1], "target": 6 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [128,1,1,1,64,32], "target": 6 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [64,16,16,1,1], "target": 6 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [32,1,1,32,1,64,1], "target": 6 }
assert my_solution.minOperations(**test_input) == 3

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

test_input = { "nums": [1,1,256,1,64,1,128], "target": 6 }
assert my_solution.minOperations(**test_input) == 4

test_input = { "nums": [1,1,64,64,32,2], "target": 6 }
assert my_solution.minOperations(**test_input) == 3

test_input = { "nums": [2,32,128,1,64], "target": 6 }
assert my_solution.minOperations(**test_input) == 3

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

test_input = { "nums": [64,8,2,128], "target": 6 }
assert my_solution.minOperations(**test_input) == 1

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

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

test_input = { "nums": [1,1,1,1,1,1,1], "target": 7 }
assert my_solution.minOperations(**test_input) == 0

test_input = { "nums": [1,1,1,1,128,1,64,8], "target": 7 }
assert my_solution.minOperations(**test_input) == 1

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

test_input = { "nums": [1,2,64,32,16,1,1], "target": 7 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [1,1,1,16,128,256,1,1], "target": 7 }
assert my_solution.minOperations(**test_input) == 2

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

test_input = { "nums": [2,8,8,1,128,1,1], "target": 7 }
assert my_solution.minOperations(**test_input) == 1

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

test_input = { "nums": [32,1,2,1,256,128], "target": 7 }
assert my_solution.minOperations(**test_input) == 3

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

test_input = { "nums": [1,8,256,32,1], "target": 7 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [64,1,1,1,16,1,64,1], "target": 7 }
assert my_solution.minOperations(**test_input) == 2

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

test_input = { "nums": [1,256,1,8,1,2,16], "target": 7 }
assert my_solution.minOperations(**test_input) == 1

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

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

test_input = { "nums": [64,1,32,256,1,1,1], "target": 7 }
assert my_solution.minOperations(**test_input) == 3

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

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

test_input = { "nums": [1,1,8,1,1,64,1,128], "target": 7 }
assert my_solution.minOperations(**test_input) == 1

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

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

test_input = { "nums": [1,1,1,128,8,32,1,1], "target": 7 }
assert my_solution.minOperations(**test_input) == 1

test_input = { "nums": [64,256,1,1,1,32,2], "target": 7 }
assert my_solution.minOperations(**test_input) == 3

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

test_input = { "nums": [1,256,64,2,1,128], "target": 7 }
assert my_solution.minOperations(**test_input) == 4

test_input = { "nums": [256,1,1,1,64,1,1,64], "target": 7 }
assert my_solution.minOperations(**test_input) == 4

test_input = { "nums": [2,1,8,256,1,128,1], "target": 7 }
assert my_solution.minOperations(**test_input) == 1

test_input = { "nums": [1,1,16,1,1,256,1,128], "target": 7 }
assert my_solution.minOperations(**test_input) == 2

test_input = { "nums": [1,8,128,1,1,1,256], "target": 7 }
assert my_solution.minOperations(**test_input) == 1

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

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


maximize-value-of-function-in-a-ball-passing-game

Maximize Value of Function in a Ball Passing Game

Prompt:
"""
You are given a 0-indexed integer array receiver of length n and an integer k.

There are n players having a unique id in the range [0, n - 1] who will play a ball passing game, and receiver[i] is the id of the player who receives passes from the player with id i. Players can pass to themselves, i.e. receiver[i] may be equal to i.

You must choose one of the n players as the starting player for the game, and the ball will be passed exactly k times starting from the chosen player.

For a chosen starting player having id x, we define a function f(x) that denotes the sum of x and the ids of all players who receive the ball during the k passes, including repetitions. In other words, f(x) = x + receiver[x] + receiver[receiver[x]] + ... + receiver(k)[x].

Your task is to choose a starting player having id x that maximizes the value of f(x).

Return an integer denoting the maximum value of the function.

Note: receiver may contain duplicates.

Example 1:

Pass Number Sender ID Receiver ID x + Receiver IDs       2 1 2 1 3 2 1 0 3 3 0 2 5 4 2 1 6

Input: receiver = [2,0,1], k = 4
Output: 6
Explanation: The table above shows a simulation of the game starting with the player having id x = 2.
From the table, f(2) is equal to 6.
It can be shown that 6 is the maximum achievable value of the function.
Hence, the output is 6.

Example 2:

Pass Number Sender ID Receiver ID x + Receiver IDs       4 1 4 3 7 2 3 2 9 3 2 1 10

Input: receiver = [1,1,1,2,3], k = 3
Output: 10
Explanation: The table above shows a simulation of the game starting with the player having id x = 4.
From the table, f(4) is equal to 10.
It can be shown that 10 is the maximum achievable value of the function.
Hence, the output is 10.

Constraints:

 * 1 <= receiver.length == n <= 105
 * 0 <= receiver[i] <= n - 1
 * 1 <= k <= 1010
"""
class Solution:
    def getMaxFunctionValue(self, receiver: List[int], k: int) -> int:

You are given a 0-indexed integer array receiver of length n and an integer k.

There are n players having a unique id in the range [0, n - 1] who will play a ball passing game, and receiver[i] is the id of the player who receives passes from the player with id i. Players can pass to themselves, i.e. receiver[i] may be equal to i.

You must choose one of the n players as the starting player for the game, and the ball will be passed exactly k times starting from the chosen player.

For a chosen starting player having id x, we define a function f(x) that denotes the sum of x and the ids of all players who receive the ball during the k passes, including repetitions. In other words, f(x) = x + receiver[x] + receiver[receiver[x]] + ... + receiver(k)[x].

Your task is to choose a starting player having id x that maximizes the value of f(x).

Return an integer denoting the maximum value of the function.

Note: receiver may contain duplicates.

Example 1:

Pass Number Sender ID Receiver ID x + Receiver IDs       2 1 2 1 3 2 1 0 3 3 0 2 5 4 2 1 6

Input: receiver = [2,0,1], k = 4
Output: 6
Explanation: The table above shows a simulation of the game starting with the player having id x = 2.
From the table, f(2) is equal to 6.
It can be shown that 6 is the maximum achievable value of the function.
Hence, the output is 6.

Example 2:

Pass Number Sender ID Receiver ID x + Receiver IDs       4 1 4 3 7 2 3 2 9 3 2 1 10

Input: receiver = [1,1,1,2,3], k = 3
Output: 10
Explanation: The table above shows a simulation of the game starting with the player having id x = 4.
From the table, f(4) is equal to 10.
It can be shown that 10 is the maximum achievable value of the function.
Hence, the output is 10.

Constraints:

 * 1 <= receiver.length == n <= 105
 * 0 <= receiver[i] <= n - 1
 * 1 <= k <= 1010

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

```

my_solution = Solution()

test_input = { "receiver": [2,0,1], "k": 4 }
assert my_solution.getMaxFunctionValue(**test_input) == 6

test_input = { "receiver": [1,1,1,2,3], "k": 3 }
assert my_solution.getMaxFunctionValue(**test_input) == 10

test_input = { "receiver": [0], "k": 1 }
assert my_solution.getMaxFunctionValue(**test_input) == 0

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

test_input = { "receiver": [0], "k": 3 }
assert my_solution.getMaxFunctionValue(**test_input) == 0

test_input = { "receiver": [0], "k": 100 }
assert my_solution.getMaxFunctionValue(**test_input) == 0

test_input = { "receiver": [0,0], "k": 1 }
assert my_solution.getMaxFunctionValue(**test_input) == 1

test_input = { "receiver": [0,0], "k": 7 }
assert my_solution.getMaxFunctionValue(**test_input) == 1

test_input = { "receiver": [0,0], "k": 10 }
assert my_solution.getMaxFunctionValue(**test_input) == 1

test_input = { "receiver": [0,0], "k": 13 }
assert my_solution.getMaxFunctionValue(**test_input) == 1

test_input = { "receiver": [0,0], "k": 16 }
assert my_solution.getMaxFunctionValue(**test_input) == 1

test_input = { "receiver": [0,1], "k": 1 }
assert my_solution.getMaxFunctionValue(**test_input) == 2

test_input = { "receiver": [0,1], "k": 3 }
assert my_solution.getMaxFunctionValue(**test_input) == 4

test_input = { "receiver": [0,1], "k": 5 }
assert my_solution.getMaxFunctionValue(**test_input) == 6

test_input = { "receiver": [0,1], "k": 8 }
assert my_solution.getMaxFunctionValue(**test_input) == 9

test_input = { "receiver": [0,1], "k": 13 }
assert my_solution.getMaxFunctionValue(**test_input) == 14

test_input = { "receiver": [0,1], "k": 14 }
assert my_solution.getMaxFunctionValue(**test_input) == 15

test_input = { "receiver": [0,1], "k": 15 }
assert my_solution.getMaxFunctionValue(**test_input) == 16

test_input = { "receiver": [1,0], "k": 5 }
assert my_solution.getMaxFunctionValue(**test_input) == 3

test_input = { "receiver": [1,0], "k": 6 }
assert my_solution.getMaxFunctionValue(**test_input) == 4

test_input = { "receiver": [1,0], "k": 7 }
assert my_solution.getMaxFunctionValue(**test_input) == 4

test_input = { "receiver": [1,0], "k": 10 }
assert my_solution.getMaxFunctionValue(**test_input) == 6

test_input = { "receiver": [1,0], "k": 12 }
assert my_solution.getMaxFunctionValue(**test_input) == 7

test_input = { "receiver": [1,0], "k": 14 }
assert my_solution.getMaxFunctionValue(**test_input) == 8

test_input = { "receiver": [1,0], "k": 57 }
assert my_solution.getMaxFunctionValue(**test_input) == 29

test_input = { "receiver": [1,1], "k": 1 }
assert my_solution.getMaxFunctionValue(**test_input) == 2

test_input = { "receiver": [1,1], "k": 2 }
assert my_solution.getMaxFunctionValue(**test_input) == 3

test_input = { "receiver": [1,1], "k": 7 }
assert my_solution.getMaxFunctionValue(**test_input) == 8

test_input = { "receiver": [0,0,0], "k": 1 }
assert my_solution.getMaxFunctionValue(**test_input) == 2

test_input = { "receiver": [0,0,0], "k": 4 }
assert my_solution.getMaxFunctionValue(**test_input) == 2

test_input = { "receiver": [0,0,0], "k": 6 }
assert my_solution.getMaxFunctionValue(**test_input) == 2

test_input = { "receiver": [0,0,0], "k": 10 }
assert my_solution.getMaxFunctionValue(**test_input) == 2

test_input = { "receiver": [0,0,1], "k": 3 }
assert my_solution.getMaxFunctionValue(**test_input) == 3

test_input = { "receiver": [0,0,1], "k": 9 }
assert my_solution.getMaxFunctionValue(**test_input) == 3

test_input = { "receiver": [0,0,2], "k": 11 }
assert my_solution.getMaxFunctionValue(**test_input) == 24

test_input = { "receiver": [0,0,2], "k": 14 }
assert my_solution.getMaxFunctionValue(**test_input) == 30

test_input = { "receiver": [0,0,2], "k": 82 }
assert my_solution.getMaxFunctionValue(**test_input) == 166

test_input = { "receiver": [0,1,0], "k": 5 }
assert my_solution.getMaxFunctionValue(**test_input) == 6

test_input = { "receiver": [0,1,1], "k": 2 }
assert my_solution.getMaxFunctionValue(**test_input) == 4

test_input = { "receiver": [0,1,2], "k": 3 }
assert my_solution.getMaxFunctionValue(**test_input) == 8

test_input = { "receiver": [0,1,2], "k": 6 }
assert my_solution.getMaxFunctionValue(**test_input) == 14

test_input = { "receiver": [1,0,0], "k": 6 }
assert my_solution.getMaxFunctionValue(**test_input) == 5

test_input = { "receiver": [1,0,1], "k": 2 }
assert my_solution.getMaxFunctionValue(**test_input) == 3

test_input = { "receiver": [1,0,2], "k": 10 }
assert my_solution.getMaxFunctionValue(**test_input) == 22

test_input = { "receiver": [1,1,1], "k": 4 }
assert my_solution.getMaxFunctionValue(**test_input) == 6

test_input = { "receiver": [1,1,1], "k": 6 }
assert my_solution.getMaxFunctionValue(**test_input) == 8

test_input = { "receiver": [1,1,2], "k": 8 }
assert my_solution.getMaxFunctionValue(**test_input) == 18

test_input = { "receiver": [1,2,0], "k": 3 }
assert my_solution.getMaxFunctionValue(**test_input) == 5

test_input = { "receiver": [1,2,0], "k": 8 }
assert my_solution.getMaxFunctionValue(**test_input) == 9

test_input = { "receiver": [1,2,1], "k": 6 }
assert my_solution.getMaxFunctionValue(**test_input) == 11

test_input = { "receiver": [1,2,2], "k": 7 }
assert my_solution.getMaxFunctionValue(**test_input) == 16

test_input = { "receiver": [2,0,2], "k": 6 }
assert my_solution.getMaxFunctionValue(**test_input) == 14

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

test_input = { "receiver": [2,1,0], "k": 8 }
assert my_solution.getMaxFunctionValue(**test_input) == 10

test_input = { "receiver": [2,1,0], "k": 10 }
assert my_solution.getMaxFunctionValue(**test_input) == 12

test_input = { "receiver": [2,1,1], "k": 4 }
assert my_solution.getMaxFunctionValue(**test_input) == 6

test_input = { "receiver": [2,1,2], "k": 2 }
assert my_solution.getMaxFunctionValue(**test_input) == 6

test_input = { "receiver": [2,1,2], "k": 15 }
assert my_solution.getMaxFunctionValue(**test_input) == 32

test_input = { "receiver": [2,2,0], "k": 4 }
assert my_solution.getMaxFunctionValue(**test_input) == 6

test_input = { "receiver": [2,2,0], "k": 9 }
assert my_solution.getMaxFunctionValue(**test_input) == 11

test_input = { "receiver": [2,2,1], "k": 1 }
assert my_solution.getMaxFunctionValue(**test_input) == 3

test_input = { "receiver": [2,2,1], "k": 10 }
assert my_solution.getMaxFunctionValue(**test_input) == 17

test_input = { "receiver": [2,2,2], "k": 15 }
assert my_solution.getMaxFunctionValue(**test_input) == 32

test_input = { "receiver": [0,0,3,0], "k": 4 }
assert my_solution.getMaxFunctionValue(**test_input) == 5

test_input = { "receiver": [0,1,0,1], "k": 11 }
assert my_solution.getMaxFunctionValue(**test_input) == 14

test_input = { "receiver": [0,1,1,3], "k": 5 }
assert my_solution.getMaxFunctionValue(**test_input) == 18

test_input = { "receiver": [0,2,1,3], "k": 5 }
assert my_solution.getMaxFunctionValue(**test_input) == 18

test_input = { "receiver": [0,2,3,1], "k": 6 }
assert my_solution.getMaxFunctionValue(**test_input) == 15

test_input = { "receiver": [0,2,3,3], "k": 8 }
assert my_solution.getMaxFunctionValue(**test_input) == 27

test_input = { "receiver": [0,2,3,3], "k": 15 }
assert my_solution.getMaxFunctionValue(**test_input) == 48

test_input = { "receiver": [0,3,3,0], "k": 10 }
assert my_solution.getMaxFunctionValue(**test_input) == 5

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

test_input = { "receiver": [1,0,1,2], "k": 15 }
assert my_solution.getMaxFunctionValue(**test_input) == 12

test_input = { "receiver": [1,0,3,1], "k": 6 }
assert my_solution.getMaxFunctionValue(**test_input) == 8

test_input = { "receiver": [1,0,3,2], "k": 2 }
assert my_solution.getMaxFunctionValue(**test_input) == 8

test_input = { "receiver": [1,1,0,0], "k": 2 }
assert my_solution.getMaxFunctionValue(**test_input) == 4

test_input = { "receiver": [1,1,0,3], "k": 3 }
assert my_solution.getMaxFunctionValue(**test_input) == 12

test_input = { "receiver": [1,1,1,3], "k": 7 }
assert my_solution.getMaxFunctionValue(**test_input) == 24

test_input = { "receiver": [1,2,0,0], "k": 14 }
assert my_solution.getMaxFunctionValue(**test_input) == 16

test_input = { "receiver": [1,2,0,1], "k": 5 }
assert my_solution.getMaxFunctionValue(**test_input) == 9

test_input = { "receiver": [1,2,3,1], "k": 47 }
assert my_solution.getMaxFunctionValue(**test_input) == 96

test_input = { "receiver": [1,3,0,1], "k": 2 }
assert my_solution.getMaxFunctionValue(**test_input) == 7

test_input = { "receiver": [1,3,3,0], "k": 7 }
assert my_solution.getMaxFunctionValue(**test_input) == 13

test_input = { "receiver": [2,0,0,1], "k": 9 }
assert my_solution.getMaxFunctionValue(**test_input) == 12

test_input = { "receiver": [2,0,0,2], "k": 12 }
assert my_solution.getMaxFunctionValue(**test_input) == 15

test_input = { "receiver": [2,0,2,0], "k": 5 }
assert my_solution.getMaxFunctionValue(**test_input) == 12

test_input = { "receiver": [2,1,0,0], "k": 8 }
assert my_solution.getMaxFunctionValue(**test_input) == 11

test_input = { "receiver": [2,1,0,1], "k": 97 }
assert my_solution.getMaxFunctionValue(**test_input) == 100

test_input = { "receiver": [2,2,2,0], "k": 1 }
assert my_solution.getMaxFunctionValue(**test_input) == 4

test_input = { "receiver": [2,2,3,2], "k": 8 }
assert my_solution.getMaxFunctionValue(**test_input) == 23

test_input = { "receiver": [2,3,2,1], "k": 56 }
assert my_solution.getMaxFunctionValue(**test_input) == 115

test_input = { "receiver": [2,3,3,1], "k": 15 }
assert my_solution.getMaxFunctionValue(**test_input) == 33

test_input = { "receiver": [2,3,3,3], "k": 2 }
assert my_solution.getMaxFunctionValue(**test_input) == 9

test_input = { "receiver": [3,0,0,1], "k": 4 }
assert my_solution.getMaxFunctionValue(**test_input) == 8

test_input = { "receiver": [3,0,0,2], "k": 85 }
assert my_solution.getMaxFunctionValue(**test_input) == 145

test_input = { "receiver": [3,0,1,3], "k": 9 }
assert my_solution.getMaxFunctionValue(**test_input) == 30

test_input = { "receiver": [3,1,1,2], "k": 7 }
assert my_solution.getMaxFunctionValue(**test_input) == 11

test_input = { "receiver": [3,1,2,0], "k": 60 }
assert my_solution.getMaxFunctionValue(**test_input) == 122

test_input = { "receiver": [3,2,0,3], "k": 12 }
assert my_solution.getMaxFunctionValue(**test_input) == 39

test_input = { "receiver": [3,3,0,1], "k": 1 }
assert my_solution.getMaxFunctionValue(**test_input) == 4


check-if-a-string-is-an-acronym-of-words

Check if a String Is an Acronym of Words

Prompt:
"""
Given an array of strings words and a string s, determine if s is an acronym of words.

The string s is considered an acronym of words if it can be formed by concatenating the first character of each string in words in order. For example, "ab" can be formed from ["apple", "banana"], but it can't be formed from ["bear", "aardvark"].

Return true if s is an acronym of words, and false otherwise.

Example 1:

Input: words = ["alice","bob","charlie"], s = "abc"
Output: true
Explanation: The first character in the words "alice", "bob", and "charlie" are 'a', 'b', and 'c', respectively. Hence, s = "abc" is the acronym.

Example 2:

Input: words = ["an","apple"], s = "a"
Output: false
Explanation: The first character in the words "an" and "apple" are 'a' and 'a', respectively.
The acronym formed by concatenating these characters is "aa".
Hence, s = "a" is not the acronym.

Example 3:

Input: words = ["never","gonna","give","up","on","you"], s = "ngguoy"
Output: true
Explanation: By concatenating the first character of the words in the array, we get the string "ngguoy".
Hence, s = "ngguoy" is the acronym.

Constraints:

 * 1 <= words.length <= 100
 * 1 <= words[i].length <= 10
 * 1 <= s.length <= 100
 * words[i] and s consist of lowercase English letters.
"""
class Solution:
    def isAcronym(self, words: List[str], s: str) -> bool:

Given an array of strings words and a string s, determine if s is an acronym of words.

The string s is considered an acronym of words if it can be formed by concatenating the first character of each string in words in order. For example, "ab" can be formed from ["apple", "banana"], but it can't be formed from ["bear", "aardvark"].

Return true if s is an acronym of words, and false otherwise.

Example 1:

Input: words = ["alice","bob","charlie"], s = "abc"
Output: true
Explanation: The first character in the words "alice", "bob", and "charlie" are 'a', 'b', and 'c', respectively. Hence, s = "abc" is the acronym.

Example 2:

Input: words = ["an","apple"], s = "a"
Output: false
Explanation: The first character in the words "an" and "apple" are 'a' and 'a', respectively.
The acronym formed by concatenating these characters is "aa".
Hence, s = "a" is not the acronym.

Example 3:

Input: words = ["never","gonna","give","up","on","you"], s = "ngguoy"
Output: true
Explanation: By concatenating the first character of the words in the array, we get the string "ngguoy".
Hence, s = "ngguoy" is the acronym.

Constraints:

 * 1 <= words.length <= 100
 * 1 <= words[i].length <= 10
 * 1 <= s.length <= 100
 * words[i] and s consist of lowercase English letters.

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

```

my_solution = Solution()

test_input = { "words": ["an","apple"], "s": "a" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["alice","bob","charlie"], "s": "abc" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["never","gonna","give","up","on","you"], "s": "ngguoy" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["ad","uadhrwxki"], "s": "au" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["afqcpzsx","icenu"], "s": "yi" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["afkc","icxufam"], "s": "ai" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["ahbibag","aoximesw"], "s": "aa" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["auqoc","koioxa"], "s": "ak" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["b","x"], "s": "bx" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["c","df"], "s": "bd" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["dv","g"], "s": "sg" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["dvn","acafe"], "s": "dp" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["bpctc","kaqquqbpmw"], "s": "bk" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["c","evlvvhrsqa"], "s": "ce" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["dwrvgkxdtm","wy"], "s": "hw" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["eceekigel","gmgdfvsrkw"], "s": "wg" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["cfsrsyt","md"], "s": "cm" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["envpklvi","jpymde"], "s": "en" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["espleklys","dg"], "s": "ea" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["euptjhixnu","fwci"], "s": "kf" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["ddnlfpvy","exs"], "s": "de" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["deacf","hldiauk"], "s": "dh" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["dllcn","tnzrnzypg"], "s": "dt" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["dmekslxlpo","wqdgxqwdk"], "s": "dw" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["eyzywjsxza","jxeimcc"], "s": "ex" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["f","oylvtltvo"], "s": "ho" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["eo","e"], "s": "ee" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["eucvcqdgg","qtdwhygerb"], "s": "eq" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["fnpow","ysqwqli"], "s": "jy" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["gpqyvv","kihi"], "s": "ik" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["exrgiw","irexgmrl"], "s": "ei" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["ez","acnmits"], "s": "ea" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["fvkekkv","jfbv"], "s": "fj" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["kncge","nje"], "s": "kw" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["fyocwzlz","lz"], "s": "fl" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["mnh","clep"], "s": "pc" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["mnpdwq","hziusbxr"], "s": "mg" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["g","r"], "s": "gr" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["n","fddigeie"], "s": "hf" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["gle","irt"], "s": "gi" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["h","xhtkcj"], "s": "hx" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["n","ityua"], "s": "ei" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["nmxysdim","xnpqsauh"], "s": "ne" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["ovdhflcck","ndd"], "s": "oi" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["piiyodecdf","wdwfxsjfou"], "s": "pp" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["hdmwkr","jfrqh"], "s": "hj" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["hflf","fvnotmdcpw"], "s": "hf" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["hnwphhozqw","cfhsjlqj"], "s": "hc" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["pxcsaaa","lrvxsc"], "s": "pz" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["htlsq","y"], "s": "hy" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["iakfeop","pd"], "s": "ip" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["qir","qyyzmntl"], "s": "qa" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["iakfmr","gzggxzwor"], "s": "ig" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["jna","rjdbu"], "s": "jr" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["qunqyc","ouzjotitvn"], "s": "co" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["rdednrsn","yfrgdeapme"], "s": "ny" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["rtnbfaemv","kgpcwaoik"], "s": "rf" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["s","n"], "s": "sx" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["siiyqtkyis","mogzgabcgk"], "s": "fm" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["tit","pmuqzrs"], "s": "tz" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["uip","hhstwupgg"], "s": "eh" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["uyj","jlfnksqlt"], "s": "ur" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["kabfejv","g"], "s": "kg" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["w","eshensjifo"], "s": "ez" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["khhhdsaevp","dnod"], "s": "kd" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["wefmc","tmunsmg"], "s": "jt" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["wo","jhaabx"], "s": "wx" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["kltil","mubemf"], "s": "km" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["kxkvhylsh","gyshntskq"], "s": "kg" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["wseopbedw","iihrgujev"], "s": "wq" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["kzxp","fy"], "s": "kf" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["wvdx","jerzn"], "s": "cj" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["y","qppnclhhbd"], "s": "mq" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["yegnsnddq","kusrkz"], "s": "bk" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["couqsa","sncuru","jhgxpxipg"], "s": "csa" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["csm","hexhvojfj","l"], "s": "chh" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["lbor","zx"], "s": "lz" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["losinu","ptsjoihvj"], "s": "lp" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["maczdfm","ywj"], "s": "my" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["d","geviina","tyljs"], "s": "dvt" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["mammhva","igyzbwpj"], "s": "mi" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["ecmlkida","vrjwdpe","vocff"], "s": "hvv" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["emqlklvrw","das","bzuq"], "s": "edm" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["hawikjbs","qi","ssvgttkzd"], "s": "rornirdphvargyce" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["hd","f","meivn"], "s": "hpm" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["mqhptbyzzv","mfubjraiqz"], "s": "mm" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["mvftnzftb","ga"], "s": "mg" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["ncgutvi","rsh"], "s": "nr" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["ntf","txayzc"], "s": "nt" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["nubibbe","wzwdrjcck"], "s": "nw" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["hphfek","kezkkq","oh"], "s": "hmo" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["odtclcvcj","ufhrhk"], "s": "ou" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["ojcn","naujlz"], "s": "on" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["iho","ignyipken","q"], "s": "wiq" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["olynt","xf"], "s": "ox" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["ir","wzhmxee","kjfwful"], "s": "iwn" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["ixo","wigba","raaphui"], "s": "dwr" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["opup","eme"], "s": "oe" }
assert my_solution.isAcronym(**test_input) == True

test_input = { "words": ["kmmoq","aoh","hznkpurdh"], "s": "kar" }
assert my_solution.isAcronym(**test_input) == False

test_input = { "words": ["ottxwi","akpixfvbel"], "s": "oa" }
assert my_solution.isAcronym(**test_input) == True


determine-the-minimum-sum-of-a-k-avoiding-array

Determine the Minimum Sum of a k-avoiding Array

Prompt:
"""
You are given two integers, n and k.

An array of distinct positive integers is called a k-avoiding array if there does not exist any pair of distinct elements that sum to k.

Return the minimum possible sum of a k-avoiding array of length n.

Example 1:

Input: n = 5, k = 4
Output: 18
Explanation: Consider the k-avoiding array [1,2,4,5,6], which has a sum of 18.
It can be proven that there is no k-avoiding array with a sum less than 18.

Example 2:

Input: n = 2, k = 6
Output: 3
Explanation: We can construct the array [1,2], which has a sum of 3.
It can be proven that there is no k-avoiding array with a sum less than 3.

Constraints:

 * 1 <= n, k <= 50
"""
class Solution:
    def minimumSum(self, n: int, k: int) -> int:

You are given two integers, n and k.

An array of distinct positive integers is called a k-avoiding array if there does not exist any pair of distinct elements that sum to k.

Return the minimum possible sum of a k-avoiding array of length n.

Example 1:

Input: n = 5, k = 4
Output: 18
Explanation: Consider the k-avoiding array [1,2,4,5,6], which has a sum of 18.
It can be proven that there is no k-avoiding array with a sum less than 18.

Example 2:

Input: n = 2, k = 6
Output: 3
Explanation: We can construct the array [1,2], which has a sum of 3.
It can be proven that there is no k-avoiding array with a sum less than 3.

Constraints:

 * 1 <= n, k <= 50

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

```

my_solution = Solution()

test_input = { "n": 5, "k": 4 }
assert my_solution.minimumSum(**test_input) == 18

test_input = { "n": 2, "k": 6 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 1, "k": 1 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 2 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 3 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 4 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 5 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 6 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 7 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 8 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 9 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 10 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 11 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 12 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 13 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 14 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 15 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 16 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 17 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 18 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 19 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 20 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 21 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 22 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 23 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 24 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 25 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 26 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 27 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 28 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 29 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 30 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 31 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 32 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 33 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 34 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 35 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 36 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 37 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 38 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 39 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 40 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 41 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 42 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 43 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 44 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 45 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 46 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 47 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 48 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 49 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 1, "k": 50 }
assert my_solution.minimumSum(**test_input) == 1

test_input = { "n": 2, "k": 1 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 2 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 3 }
assert my_solution.minimumSum(**test_input) == 4

test_input = { "n": 2, "k": 4 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 5 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 7 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 8 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 9 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 10 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 11 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 12 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 13 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 14 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 15 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 16 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 17 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 18 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 19 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 20 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 21 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 22 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 23 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 24 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 25 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 26 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 27 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 28 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 29 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 30 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 31 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 32 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 33 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 34 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 35 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 36 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 37 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 38 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 39 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 40 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 41 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 42 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 43 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 44 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 45 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 46 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 47 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 48 }
assert my_solution.minimumSum(**test_input) == 3

test_input = { "n": 2, "k": 49 }
assert my_solution.minimumSum(**test_input) == 3


maximize-the-profit-as-the-salesman

Maximize the Profit as the Salesman

Prompt:
"""
You are given an integer n representing the number of houses on a number line, numbered from 0 to n - 1.

Additionally, you are given a 2D integer array offers where offers[i] = [starti, endi, goldi], indicating that ith buyer wants to buy all the houses from starti to endi for goldi amount of gold.

As a salesman, your goal is to maximize your earnings by strategically selecting and selling houses to buyers.

Return the maximum amount of gold you can earn.

Note that different buyers can't buy the same house, and some houses may remain unsold.

Example 1:

Input: n = 5, offers = [[0,0,1],[0,2,2],[1,3,2]]
Output: 3
Explanation: There are 5 houses numbered from 0 to 4 and there are 3 purchase offers.
We sell houses in the range [0,0] to 1st buyer for 1 gold and houses in the range [1,3] to 3rd buyer for 2 golds.
It can be proven that 3 is the maximum amount of gold we can achieve.

Example 2:

Input: n = 5, offers = [[0,0,1],[0,2,10],[1,3,2]]
Output: 10
Explanation: There are 5 houses numbered from 0 to 4 and there are 3 purchase offers.
We sell houses in the range [0,2] to 2nd buyer for 10 golds.
It can be proven that 10 is the maximum amount of gold we can achieve.

Constraints:

 * 1 <= n <= 105
 * 1 <= offers.length <= 105
 * offers[i].length == 3
 * 0 <= starti <= endi <= n - 1
 * 1 <= goldi <= 103
"""
class Solution:
    def maximizeTheProfit(self, n: int, offers: List[List[int]]) -> int:

You are given an integer n representing the number of houses on a number line, numbered from 0 to n - 1.

Additionally, you are given a 2D integer array offers where offers[i] = [starti, endi, goldi], indicating that ith buyer wants to buy all the houses from starti to endi for goldi amount of gold.

As a salesman, your goal is to maximize your earnings by strategically selecting and selling houses to buyers.

Return the maximum amount of gold you can earn.

Note that different buyers can't buy the same house, and some houses may remain unsold.

Example 1:

Input: n = 5, offers = [[0,0,1],[0,2,2],[1,3,2]]
Output: 3
Explanation: There are 5 houses numbered from 0 to 4 and there are 3 purchase offers.
We sell houses in the range [0,0] to 1st buyer for 1 gold and houses in the range [1,3] to 3rd buyer for 2 golds.
It can be proven that 3 is the maximum amount of gold we can achieve.

Example 2:

Input: n = 5, offers = [[0,0,1],[0,2,10],[1,3,2]]
Output: 10
Explanation: There are 5 houses numbered from 0 to 4 and there are 3 purchase offers.
We sell houses in the range [0,2] to 2nd buyer for 10 golds.
It can be proven that 10 is the maximum amount of gold we can achieve.

Constraints:

 * 1 <= n <= 105
 * 1 <= offers.length <= 105
 * offers[i].length == 3
 * 0 <= starti <= endi <= n - 1
 * 1 <= goldi <= 103

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

```


find-the-longest-equal-subarray

Find the Longest Equal Subarray

Prompt:
"""
You are given a 0-indexed integer array nums and an integer k.

A subarray is called equal if all of its elements are equal. Note that the empty subarray is an equal subarray.

Return the length of the longest possible equal subarray after deleting at most k elements from nums.

A subarray is a contiguous, possibly empty sequence of elements within an array.

Example 1:

Input: nums = [1,3,2,3,1,3], k = 3
Output: 3
Explanation: It's optimal to delete the elements at index 2 and index 4.
After deleting them, nums becomes equal to [1, 3, 3, 3].
The longest equal subarray starts at i = 1 and ends at j = 3 with length equal to 3.
It can be proven that no longer equal subarrays can be created.

Example 2:

Input: nums = [1,1,2,2,1,1], k = 2
Output: 4
Explanation: It's optimal to delete the elements at index 2 and index 3.
After deleting them, nums becomes equal to [1, 1, 1, 1].
The array itself is an equal subarray, so the answer is 4.
It can be proven that no longer equal subarrays can be created.

Constraints:

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

You are given a 0-indexed integer array nums and an integer k.

A subarray is called equal if all of its elements are equal. Note that the empty subarray is an equal subarray.

Return the length of the longest possible equal subarray after deleting at most k elements from nums.

A subarray is a contiguous, possibly empty sequence of elements within an array.

Example 1:

Input: nums = [1,3,2,3,1,3], k = 3
Output: 3
Explanation: It's optimal to delete the elements at index 2 and index 4.
After deleting them, nums becomes equal to [1, 3, 3, 3].
The longest equal subarray starts at i = 1 and ends at j = 3 with length equal to 3.
It can be proven that no longer equal subarrays can be created.

Example 2:

Input: nums = [1,1,2,2,1,1], k = 2
Output: 4
Explanation: It's optimal to delete the elements at index 2 and index 3.
After deleting them, nums becomes equal to [1, 1, 1, 1].
The array itself is an equal subarray, so the answer is 4.
It can be proven that no longer equal subarrays can be created.

Constraints:

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

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

```

my_solution = Solution()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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