insert-greatest-common-divisors-in-linked-list

Insert Greatest Common Divisors in Linked List

Prompt:
"""
Given the head of a linked list head, in which each node contains an integer value.

Between every pair of adjacent nodes, insert a new node with a value equal to the greatest common divisor of them.

Return the linked list after insertion.

The greatest common divisor of two numbers is the largest positive integer that evenly divides both numbers.

Example 1:

[https://assets.leetcode.com/uploads/2023/07/18/ex1_copy.png]

Input: head = [18,6,10,3]
Output: [18,6,6,2,10,1,3]
Explanation: The 1st diagram denotes the initial linked list and the 2nd diagram denotes the linked list after inserting the new nodes (nodes in blue are the inserted nodes).
- We insert the greatest common divisor of 18 and 6 = 6 between the 1st and the 2nd nodes.
- We insert the greatest common divisor of 6 and 10 = 2 between the 2nd and the 3rd nodes.
- We insert the greatest common divisor of 10 and 3 = 1 between the 3rd and the 4th nodes.
There are no more adjacent nodes, so we return the linked list.

Example 2:

[https://assets.leetcode.com/uploads/2023/07/18/ex2_copy1.png]

Input: head = [7]
Output: [7]
Explanation: The 1st diagram denotes the initial linked list and the 2nd diagram denotes the linked list after inserting the new nodes.
There are no pairs of adjacent nodes, so we return the initial linked list.

Constraints:

 * The number of nodes in the list is in the range [1, 5000].
 * 1 <= Node.val <= 1000
"""
# Definition for singly-linked list.
class ListNode:
    def __init__(self, val=0, next=None):
        self.val = val
        self.next = next
class Solution:
    def insertGreatestCommonDivisors(self, head: Optional[ListNode]) -> Optional[ListNode]:

Given the head of a linked list head, in which each node contains an integer value.

Between every pair of adjacent nodes, insert a new node with a value equal to the greatest common divisor of them.

Return the linked list after insertion.

The greatest common divisor of two numbers is the largest positive integer that evenly divides both numbers.

Example 1:

[https://assets.leetcode.com/uploads/2023/07/18/ex1_copy.png]

Input: head = [18,6,10,3]
Output: [18,6,6,2,10,1,3]
Explanation: The 1st diagram denotes the initial linked list and the 2nd diagram denotes the linked list after inserting the new nodes (nodes in blue are the inserted nodes).
- We insert the greatest common divisor of 18 and 6 = 6 between the 1st and the 2nd nodes.
- We insert the greatest common divisor of 6 and 10 = 2 between the 2nd and the 3rd nodes.
- We insert the greatest common divisor of 10 and 3 = 1 between the 3rd and the 4th nodes.
There are no more adjacent nodes, so we return the linked list.

Example 2:

[https://assets.leetcode.com/uploads/2023/07/18/ex2_copy1.png]

Input: head = [7]
Output: [7]
Explanation: The 1st diagram denotes the initial linked list and the 2nd diagram denotes the linked list after inserting the new nodes.
There are no pairs of adjacent nodes, so we return the initial linked list.

Constraints:

 * The number of nodes in the list is in the range [1, 5000].
 * 1 <= Node.val <= 1000

Please complete the code below to solve above prblem:
```python
# Definition for singly-linked list.
class ListNode:
    def __init__(self, val=0, next=None):
        self.val = val
        self.next = next
class Solution:
    def insertGreatestCommonDivisors(self, head: Optional[ListNode]) -> Optional[ListNode]:

```

my_solution = Solution()

_f1 = lambda lst: ListNode(lst[0], _f1(lst[1:])) if lst else None
_f2 = lambda node: [node.val] + _f2(node.next) if node else []

test_input = { "head": _f1([18,6,10,3]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [18,6,6,2,10,1,3]

test_input = { "head": _f1([7]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [7]

test_input = { "head": _f1([19]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [19]

test_input = { "head": _f1([2]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [2]

test_input = { "head": _f1([13]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [13]

test_input = { "head": _f1([8]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [8]

test_input = { "head": _f1([1]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [1]

test_input = { "head": _f1([3]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [3]

test_input = { "head": _f1([20]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [20]

test_input = { "head": _f1([14]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [14]

test_input = { "head": _f1([16]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [16]

test_input = { "head": _f1([12]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [12]

test_input = { "head": _f1([9]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [9]

test_input = { "head": _f1([5]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [5]

test_input = { "head": _f1([4]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [4]

test_input = { "head": _f1([18]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [18]

test_input = { "head": _f1([11]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [11]

test_input = { "head": _f1([17]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [17]

test_input = { "head": _f1([15]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [15]

test_input = { "head": _f1([11,13]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [11,1,13]

test_input = { "head": _f1([7,13]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [7,1,13]

test_input = { "head": _f1([18,17]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [18,1,17]

test_input = { "head": _f1([15,17]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [15,1,17]

test_input = { "head": _f1([13,8]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [13,1,8]

test_input = { "head": _f1([12,16]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [12,4,16]

test_input = { "head": _f1([12,8]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [12,4,8]

test_input = { "head": _f1([18,16]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [18,2,16]

test_input = { "head": _f1([16,16]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [16,16,16]

test_input = { "head": _f1([6,12]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [6,6,12]

test_input = { "head": _f1([9,6]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [9,3,6]

test_input = { "head": _f1([2,17]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [2,1,17]

test_input = { "head": _f1([7,5]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [7,1,5]

test_input = { "head": _f1([15,6]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [15,3,6]

test_input = { "head": _f1([3,14]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [3,1,14]

test_input = { "head": _f1([6,16]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [6,2,16]

test_input = { "head": _f1([3,16]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [3,1,16]

test_input = { "head": _f1([11,9]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [11,1,9]

test_input = { "head": _f1([4,15]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [4,1,15]

test_input = { "head": _f1([16,2]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [16,2,2]

test_input = { "head": _f1([12,7]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [12,1,7]

test_input = { "head": _f1([7,9]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [7,1,9]

test_input = { "head": _f1([7,3]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [7,1,3]

test_input = { "head": _f1([8,4]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [8,4,4]

test_input = { "head": _f1([4,11]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [4,1,11]

test_input = { "head": _f1([6,15]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [6,3,15]

test_input = { "head": _f1([9,7]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [9,1,7]

test_input = { "head": _f1([19,4]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [19,1,4]

test_input = { "head": _f1([17,6,18]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [17,1,6,6,18]

test_input = { "head": _f1([10,8,3]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [10,2,8,1,3]

test_input = { "head": _f1([11,4,10]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [11,1,4,2,10]

test_input = { "head": _f1([5,3,13]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [5,1,3,1,13]

test_input = { "head": _f1([2,1,15]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [2,1,1,1,15]

test_input = { "head": _f1([17,13,9]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [17,1,13,1,9]

test_input = { "head": _f1([2,15,12]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [2,1,15,3,12]

test_input = { "head": _f1([16,12,13]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [16,4,12,1,13]

test_input = { "head": _f1([1,12,19]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [1,1,12,1,19]

test_input = { "head": _f1([4,3,3]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [4,1,3,3,3]

test_input = { "head": _f1([15,11,3]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [15,1,11,1,3]

test_input = { "head": _f1([15,18,16]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [15,3,18,2,16]

test_input = { "head": _f1([20,6,7]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [20,2,6,1,7]

test_input = { "head": _f1([9,4,7]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [9,1,4,1,7]

test_input = { "head": _f1([20,11,6]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [20,1,11,1,6]

test_input = { "head": _f1([11,8,16]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [11,1,8,8,16]

test_input = { "head": _f1([1,4,12]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [1,1,4,4,12]

test_input = { "head": _f1([18,12,19]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [18,6,12,1,19]

test_input = { "head": _f1([8,11,5]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [8,1,11,1,5]

test_input = { "head": _f1([6,10,6]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [6,2,10,2,6]

test_input = { "head": _f1([3,10,16]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [3,1,10,2,16]

test_input = { "head": _f1([15,6,15]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [15,3,6,3,15]

test_input = { "head": _f1([9,5,1]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [9,1,5,1,1]

test_input = { "head": _f1([15,15,18]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [15,15,15,3,18]

test_input = { "head": _f1([3,16,13]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [3,1,16,1,13]

test_input = { "head": _f1([9,3,6]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [9,3,3,3,6]

test_input = { "head": _f1([4,14,9]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [4,2,14,1,9]

test_input = { "head": _f1([15,2,20]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [15,1,2,2,20]

test_input = { "head": _f1([13,7,19]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [13,1,7,1,19]

test_input = { "head": _f1([19,19,12]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [19,19,19,1,12]

test_input = { "head": _f1([8,6,1]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [8,2,6,1,1]

test_input = { "head": _f1([19,10,19]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [19,1,10,1,19]

test_input = { "head": _f1([6,9,17]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [6,3,9,1,17]

test_input = { "head": _f1([3,19,8]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [3,1,19,1,8]

test_input = { "head": _f1([12,6,9]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [12,6,6,3,9]

test_input = { "head": _f1([14,16,19]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [14,2,16,1,19]

test_input = { "head": _f1([12,14,16,12]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [12,2,14,2,16,4,12]

test_input = { "head": _f1([20,13,19,12]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [20,1,13,1,19,1,12]

test_input = { "head": _f1([14,13,8,8]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [14,1,13,1,8,8,8]

test_input = { "head": _f1([13,3,3,5]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [13,1,3,3,3,1,5]

test_input = { "head": _f1([11,7,15,7]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [11,1,7,1,15,1,7]

test_input = { "head": _f1([11,7,5,1]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [11,1,7,1,5,1,1]

test_input = { "head": _f1([8,7,15,13]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [8,1,7,1,15,1,13]

test_input = { "head": _f1([1,19,3,19]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [1,1,19,1,3,1,19]

test_input = { "head": _f1([15,19,1,7]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [15,1,19,1,1,1,7]

test_input = { "head": _f1([13,20,9,1]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [13,1,20,1,9,1,1]

test_input = { "head": _f1([18,16,6,9]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [18,2,16,2,6,3,9]

test_input = { "head": _f1([16,6,13,11]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [16,2,6,1,13,1,11]

test_input = { "head": _f1([9,5,1,6]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [9,1,5,1,1,1,6]

test_input = { "head": _f1([3,15,10,12]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [3,3,15,5,10,2,12]

test_input = { "head": _f1([1,9,19,15]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [1,1,9,1,19,1,15]

test_input = { "head": _f1([14,14,19,2]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [14,14,14,1,19,1,2]

test_input = { "head": _f1([5,13,5,4]) }
assert _f2(my_solution.insertGreatestCommonDivisors(**test_input)) == [5,1,13,1,5,1,4]


minimum-seconds-to-equalize-a-circular-array

Minimum Seconds to Equalize a Circular Array

Prompt:
"""
You are given a 0-indexed array nums containing n integers.

At each second, you perform the following operation on the array:

 * For every index i in the range [0, n - 1], replace nums[i] with either nums[i], nums[(i - 1 + n) % n], or nums[(i + 1) % n].

Note that all the elements get replaced simultaneously.

Return the minimum number of seconds needed to make all elements in the array nums equal.

Example 1:

Input: nums = [1,2,1,2]
Output: 1
Explanation: We can equalize the array in 1 second in the following way:
- At 1st second, replace values at each index with [nums[3],nums[1],nums[3],nums[3]]. After replacement, nums = [2,2,2,2].
It can be proven that 1 second is the minimum amount of seconds needed for equalizing the array.

Example 2:

Input: nums = [2,1,3,3,2]
Output: 2
Explanation: We can equalize the array in 2 seconds in the following way:
- At 1st second, replace values at each index with [nums[0],nums[2],nums[2],nums[2],nums[3]]. After replacement, nums = [2,3,3,3,3].
- At 2nd second, replace values at each index with [nums[1],nums[1],nums[2],nums[3],nums[4]]. After replacement, nums = [3,3,3,3,3].
It can be proven that 2 seconds is the minimum amount of seconds needed for equalizing the array.

Example 3:

Input: nums = [5,5,5,5]
Output: 0
Explanation: We don't need to perform any operations as all elements in the initial array are the same.

Constraints:

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

You are given a 0-indexed array nums containing n integers.

At each second, you perform the following operation on the array:

 * For every index i in the range [0, n - 1], replace nums[i] with either nums[i], nums[(i - 1 + n) % n], or nums[(i + 1) % n].

Note that all the elements get replaced simultaneously.

Return the minimum number of seconds needed to make all elements in the array nums equal.

Example 1:

Input: nums = [1,2,1,2]
Output: 1
Explanation: We can equalize the array in 1 second in the following way:
- At 1st second, replace values at each index with [nums[3],nums[1],nums[3],nums[3]]. After replacement, nums = [2,2,2,2].
It can be proven that 1 second is the minimum amount of seconds needed for equalizing the array.

Example 2:

Input: nums = [2,1,3,3,2]
Output: 2
Explanation: We can equalize the array in 2 seconds in the following way:
- At 1st second, replace values at each index with [nums[0],nums[2],nums[2],nums[2],nums[3]]. After replacement, nums = [2,3,3,3,3].
- At 2nd second, replace values at each index with [nums[1],nums[1],nums[2],nums[3],nums[4]]. After replacement, nums = [3,3,3,3,3].
It can be proven that 2 seconds is the minimum amount of seconds needed for equalizing the array.

Example 3:

Input: nums = [5,5,5,5]
Output: 0
Explanation: We don't need to perform any operations as all elements in the initial array are the same.

Constraints:

 * 1 <= n == nums.length <= 105
 * 1 <= nums[i] <= 109

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

```

my_solution = Solution()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

test_input = { "nums": [16,16] }
assert my_solution.minimumSeconds(**test_input) == 0

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

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

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

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

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

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

test_input = { "nums": [6,16] }
assert my_solution.minimumSeconds(**test_input) == 1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

test_input = { "nums": [16,12,13] }
assert my_solution.minimumSeconds(**test_input) == 1

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

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

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

test_input = { "nums": [15,18,16] }
assert my_solution.minimumSeconds(**test_input) == 1

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

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

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

test_input = { "nums": [11,8,16] }
assert my_solution.minimumSeconds(**test_input) == 1

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

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

test_input = { "nums": [8,11,5] }
assert my_solution.minimumSeconds(**test_input) == 1

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

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

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

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

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

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

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

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

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

test_input = { "nums": [13,7,19] }
assert my_solution.minimumSeconds(**test_input) == 1

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

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

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

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

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

test_input = { "nums": [6,9,14,16] }
assert my_solution.minimumSeconds(**test_input) == 2

test_input = { "nums": [19,12,14,16] }
assert my_solution.minimumSeconds(**test_input) == 2

test_input = { "nums": [12,20,13,19] }
assert my_solution.minimumSeconds(**test_input) == 2

test_input = { "nums": [12,14,13,8] }
assert my_solution.minimumSeconds(**test_input) == 2

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

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

test_input = { "nums": [7,11,7,5] }
assert my_solution.minimumSeconds(**test_input) == 1

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

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

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

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

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

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

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

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

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

test_input = { "nums": [15,14,14,19] }
assert my_solution.minimumSeconds(**test_input) == 1

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

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

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

test_input = { "nums": [7,17,11,8] }
assert my_solution.minimumSeconds(**test_input) == 2

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

test_input = { "nums": [11,15,19,12] }
assert my_solution.minimumSeconds(**test_input) == 2

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

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

test_input = { "nums": [14,19,8,8] }
assert my_solution.minimumSeconds(**test_input) == 1

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

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


minimum-time-to-make-array-sum-at-most-x

Minimum Time to Make Array Sum At Most x

Prompt:
"""
You are given two 0-indexed integer arrays nums1 and nums2 of equal length. Every second, for all indices 0 <= i < nums1.length, value of nums1[i] is incremented by nums2[i]. After this is done, you can do the following operation:

 * Choose an index 0 <= i < nums1.length and make nums1[i] = 0.

You are also given an integer x.

Return the minimum time in which you can make the sum of all elements of nums1 to be less than or equal to x, or -1 if this is not possible.

Example 1:

Input: nums1 = [1,2,3], nums2 = [1,2,3], x = 4
Output: 3
Explanation:
For the 1st second, we apply the operation on i = 0. Therefore nums1 = [0,2+2,3+3] = [0,4,6].
For the 2nd second, we apply the operation on i = 1. Therefore nums1 = [0+1,0,6+3] = [1,0,9].
For the 3rd second, we apply the operation on i = 2. Therefore nums1 = [1+1,0+2,0] = [2,2,0].
Now sum of nums1 = 4. It can be shown that these operations are optimal, so we return 3.

Example 2:

Input: nums1 = [1,2,3], nums2 = [3,3,3], x = 4
Output: -1
Explanation: It can be shown that the sum of nums1 will always be greater than x, no matter which operations are performed.

Constraints:

 * 1 <= nums1.length <= 103
 * 1 <= nums1[i] <= 103
 * 0 <= nums2[i] <= 103
 * nums1.length == nums2.length
 * 0 <= x <= 106
"""
class Solution:
    def minimumTime(self, nums1: List[int], nums2: List[int], x: int) -> int:

You are given two 0-indexed integer arrays nums1 and nums2 of equal length. Every second, for all indices 0 <= i < nums1.length, value of nums1[i] is incremented by nums2[i]. After this is done, you can do the following operation:

 * Choose an index 0 <= i < nums1.length and make nums1[i] = 0.

You are also given an integer x.

Return the minimum time in which you can make the sum of all elements of nums1 to be less than or equal to x, or -1 if this is not possible.

Example 1:

Input: nums1 = [1,2,3], nums2 = [1,2,3], x = 4
Output: 3
Explanation:
For the 1st second, we apply the operation on i = 0. Therefore nums1 = [0,2+2,3+3] = [0,4,6].
For the 2nd second, we apply the operation on i = 1. Therefore nums1 = [0+1,0,6+3] = [1,0,9].
For the 3rd second, we apply the operation on i = 2. Therefore nums1 = [1+1,0+2,0] = [2,2,0].
Now sum of nums1 = 4. It can be shown that these operations are optimal, so we return 3.

Example 2:

Input: nums1 = [1,2,3], nums2 = [3,3,3], x = 4
Output: -1
Explanation: It can be shown that the sum of nums1 will always be greater than x, no matter which operations are performed.

Constraints:

 * 1 <= nums1.length <= 103
 * 1 <= nums1[i] <= 103
 * 0 <= nums2[i] <= 103
 * nums1.length == nums2.length
 * 0 <= x <= 106

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

```

my_solution = Solution()

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

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

test_input = { "nums1": [4,4,9,10], "nums2": [4,4,1,3], "x": 16 }
assert my_solution.minimumTime(**test_input) == 4

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

test_input = { "nums1": [4,5,3,2,3,9,5,7,10,4], "nums2": [4,4,0,4,1,2,4,0,4,0], "x": 47 }
assert my_solution.minimumTime(**test_input) == -1

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

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

test_input = { "nums1": [4,7,2,3,4,3,10,8], "nums2": [3,4,0,1,1,0,2,2], "x": 36 }
assert my_solution.minimumTime(**test_input) == 4

test_input = { "nums1": [2,10,10,4,6,3], "nums2": [1,0,0,1,3,1], "x": 35 }
assert my_solution.minimumTime(**test_input) == 0

test_input = { "nums1": [9,5,3], "nums2": [4,1,3], "x": 17 }
assert my_solution.minimumTime(**test_input) == 0

test_input = { "nums1": [1,7,9,4,8,8,1], "nums2": [2,2,3,2,0,1,0], "x": 20 }
assert my_solution.minimumTime(**test_input) == 6

test_input = { "nums1": [9,2,8,3,1,9,7,6], "nums2": [0,3,4,1,3,4,2,1], "x": 40 }
assert my_solution.minimumTime(**test_input) == 8

test_input = { "nums1": [10], "nums2": [3], "x": 10 }
assert my_solution.minimumTime(**test_input) == 0

test_input = { "nums1": [7,6,8,2,8,9,3,3], "nums2": [2,2,4,0,0,2,2,3], "x": 45 }
assert my_solution.minimumTime(**test_input) == 5

test_input = { "nums1": [4,9,5,2,3], "nums2": [4,2,0,4,0], "x": 18 }
assert my_solution.minimumTime(**test_input) == 3

test_input = { "nums1": [2,10,2,7,8,9,7,6,6], "nums2": [4,2,1,4,3,2,4,4,4], "x": 55 }
assert my_solution.minimumTime(**test_input) == -1

test_input = { "nums1": [6,8,10,7,10,9], "nums2": [4,2,0,4,4,2], "x": 38 }
assert my_solution.minimumTime(**test_input) == 5

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

test_input = { "nums1": [5,3,2,3,10,4,7,9,1,10], "nums2": [2,0,2,0,3,3,4,4,0,1], "x": 30 }
assert my_solution.minimumTime(**test_input) == -1

test_input = { "nums1": [2,3,5], "nums2": [0,0,1], "x": 8 }
assert my_solution.minimumTime(**test_input) == 1

test_input = { "nums1": [7,9,7,9], "nums2": [4,2,0,4], "x": 32 }
assert my_solution.minimumTime(**test_input) == 0

test_input = { "nums1": [8,5,6,4,7,6,3,9,4], "nums2": [0,4,2,4,3,3,1,4,4], "x": 38 }
assert my_solution.minimumTime(**test_input) == -1

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

test_input = { "nums1": [6,6,8,7,1,7], "nums2": [2,2,1,1,2,3], "x": 27 }
assert my_solution.minimumTime(**test_input) == 5

test_input = { "nums1": [10,5], "nums2": [1,3], "x": 14 }
assert my_solution.minimumTime(**test_input) == 1

test_input = { "nums1": [10,7,1,2,6], "nums2": [4,3,2,2,4], "x": 17 }
assert my_solution.minimumTime(**test_input) == -1

test_input = { "nums1": [9,5,6,1,9,4,5,7], "nums2": [0,4,0,2,2,3,2,4], "x": 24 }
assert my_solution.minimumTime(**test_input) == -1

test_input = { "nums1": [4,1,2,4,10,7,8], "nums2": [0,2,0,4,0,2,1], "x": 18 }
assert my_solution.minimumTime(**test_input) == 5

test_input = { "nums1": [4], "nums2": [0], "x": 4 }
assert my_solution.minimumTime(**test_input) == 0

test_input = { "nums1": [4,7,1,7,5,10], "nums2": [0,4,3,2,3,1], "x": 29 }
assert my_solution.minimumTime(**test_input) == 4

test_input = { "nums1": [9,8,9,7,4,6,8,6,4], "nums2": [4,3,3,3,1,2,2,1,0], "x": 42 }
assert my_solution.minimumTime(**test_input) == -1

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

test_input = { "nums1": [6,5,2,8,8,1,6,4], "nums2": [1,2,1,0,1,0,3,1], "x": 23 }
assert my_solution.minimumTime(**test_input) == 6

test_input = { "nums1": [3,8,5,4,10,2], "nums2": [4,1,4,2,1,0], "x": 26 }
assert my_solution.minimumTime(**test_input) == 4

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

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

test_input = { "nums1": [1,8,6,8,6], "nums2": [3,0,2,4,0], "x": 16 }
assert my_solution.minimumTime(**test_input) == 4

test_input = { "nums1": [8,6], "nums2": [0,3], "x": 14 }
assert my_solution.minimumTime(**test_input) == 0

test_input = { "nums1": [3,4,5,2,4,10,6,3,6,4], "nums2": [3,0,0,2,4,2,4,1,2,1], "x": 28 }
assert my_solution.minimumTime(**test_input) == -1

test_input = { "nums1": [3,2,5,8,8], "nums2": [1,3,2,1,0], "x": 20 }
assert my_solution.minimumTime(**test_input) == 3

test_input = { "nums1": [9,2,8,7,5,2,3,2], "nums2": [3,2,3,0,4,3,1,4], "x": 37 }
assert my_solution.minimumTime(**test_input) == -1

test_input = { "nums1": [6,4,3,1,10,5,10,3,5,9], "nums2": [0,4,1,2,1,2,3,3,4,2], "x": 41 }
assert my_solution.minimumTime(**test_input) == -1

test_input = { "nums1": [6,10,7,10,6,7,7,4], "nums2": [1,3,0,0,1,2,1,3], "x": 55 }
assert my_solution.minimumTime(**test_input) == 1

test_input = { "nums1": [6,4,3,1], "nums2": [1,1,3,3], "x": 7 }
assert my_solution.minimumTime(**test_input) == -1

test_input = { "nums1": [2,10,8,10,1,4,7,10,5,1], "nums2": [4,3,1,2,3,1,3,2,2,1], "x": 29 }
assert my_solution.minimumTime(**test_input) == -1

test_input = { "nums1": [2,8,5], "nums2": [2,0,2], "x": 14 }
assert my_solution.minimumTime(**test_input) == 1

test_input = { "nums1": [7,10,1,3,7,3,2], "nums2": [1,1,3,0,2,2,3], "x": 22 }
assert my_solution.minimumTime(**test_input) == 7

test_input = { "nums1": [6,4,2,3,8,6,6,8,10], "nums2": [2,1,4,1,2,1,0,1,4], "x": 39 }
assert my_solution.minimumTime(**test_input) == 9

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

test_input = { "nums1": [2,4,1,8,3,9], "nums2": [0,2,0,0,0,4], "x": 21 }
assert my_solution.minimumTime(**test_input) == 1

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

test_input = { "nums1": [8,6], "nums2": [3,0], "x": 10 }
assert my_solution.minimumTime(**test_input) == 1

test_input = { "nums1": [5,5,5,10], "nums2": [0,1,0,3], "x": 21 }
assert my_solution.minimumTime(**test_input) == 1

test_input = { "nums1": [7,1,1,2,9,3,3,2,2], "nums2": [0,1,4,3,4,1,2,1,2], "x": 15 }
assert my_solution.minimumTime(**test_input) == -1

test_input = { "nums1": [10,4,1,10,7,5,6,3,2,10], "nums2": [4,0,4,0,3,4,3,0,0,3], "x": 50 }
assert my_solution.minimumTime(**test_input) == 9

test_input = { "nums1": [9,4,6,2], "nums2": [3,4,0,4], "x": 15 }
assert my_solution.minimumTime(**test_input) == 4

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

test_input = { "nums1": [4,5,6], "nums2": [4,4,0], "x": 13 }
assert my_solution.minimumTime(**test_input) == 2

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

test_input = { "nums1": [4,5,5,3,7], "nums2": [3,3,2,0,4], "x": 21 }
assert my_solution.minimumTime(**test_input) == 4

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

test_input = { "nums1": [9,1,8,9,7,2], "nums2": [3,3,0,2,3,4], "x": 26 }
assert my_solution.minimumTime(**test_input) == 6

test_input = { "nums1": [5,5,6,8,6,1,5,7,8], "nums2": [2,1,0,3,2,2,2,2,4], "x": 33 }
assert my_solution.minimumTime(**test_input) == -1

test_input = { "nums1": [2,9,5,5,6,7,7,9], "nums2": [1,3,0,3,3,3,4,2], "x": 47 }
assert my_solution.minimumTime(**test_input) == 8

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

test_input = { "nums1": [3,6,4,8,7,9,3,3,9], "nums2": [4,3,2,0,0,3,3,1,4], "x": 34 }
assert my_solution.minimumTime(**test_input) == -1

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

test_input = { "nums1": [1,7,6,2,9], "nums2": [4,2,3,3,0], "x": 23 }
assert my_solution.minimumTime(**test_input) == 4

test_input = { "nums1": [9,10,10,5,2,4], "nums2": [2,4,0,3,3,4], "x": 40 }
assert my_solution.minimumTime(**test_input) == 0

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

test_input = { "nums1": [1,7,2,7], "nums2": [1,0,2,3], "x": 10 }
assert my_solution.minimumTime(**test_input) == 2

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

test_input = { "nums1": [2,10,3,6,2,10,4], "nums2": [4,1,4,4,4,0,0], "x": 30 }
assert my_solution.minimumTime(**test_input) == 7

test_input = { "nums1": [5,9,6], "nums2": [1,3,2], "x": 20 }
assert my_solution.minimumTime(**test_input) == 0

test_input = { "nums1": [4,5,2,4,2,7], "nums2": [0,0,0,0,3,0], "x": 23 }
assert my_solution.minimumTime(**test_input) == 1

test_input = { "nums1": [8], "nums2": [0], "x": 7 }
assert my_solution.minimumTime(**test_input) == 1

test_input = { "nums1": [3], "nums2": [3], "x": 3 }
assert my_solution.minimumTime(**test_input) == 0

test_input = { "nums1": [6,1,10,10], "nums2": [3,2,4,0], "x": 13 }
assert my_solution.minimumTime(**test_input) == 3

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

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

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

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

test_input = { "nums1": [9,8,7,6,5,1,4], "nums2": [2,4,1,2,3,3,0], "x": 28 }
assert my_solution.minimumTime(**test_input) == 7

test_input = { "nums1": [3,4,10,1,2,4,10,3,7,2], "nums2": [4,0,0,1,1,4,4,4,2,1], "x": 44 }
assert my_solution.minimumTime(**test_input) == -1

test_input = { "nums1": [3,5,5,1,6,4,3], "nums2": [1,3,4,3,3,1,4], "x": 23 }
assert my_solution.minimumTime(**test_input) == -1

test_input = { "nums1": [3,8,10,2,5,10], "nums2": [4,0,3,2,4,3], "x": 37 }
assert my_solution.minimumTime(**test_input) == 4

test_input = { "nums1": [8,8,10,8,9,6,1,8], "nums2": [2,0,0,1,2,1,0,4], "x": 38 }
assert my_solution.minimumTime(**test_input) == 4

test_input = { "nums1": [10,7,3,10,7,6,6,10], "nums2": [1,2,4,0,3,4,0,3], "x": 41 }
assert my_solution.minimumTime(**test_input) == 7

test_input = { "nums1": [6,7,4,1,9,6], "nums2": [3,3,3,0,0,1], "x": 32 }
assert my_solution.minimumTime(**test_input) == 2

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

test_input = { "nums1": [8,9,4,5,6,7], "nums2": [0,3,4,3,3,1], "x": 27 }
assert my_solution.minimumTime(**test_input) == 6

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

test_input = { "nums1": [9], "nums2": [0], "x": 5 }
assert my_solution.minimumTime(**test_input) == 1

test_input = { "nums1": [7,2,2,2,7,4,2,10,8], "nums2": [4,3,2,4,4,0,1,1,2], "x": 31 }
assert my_solution.minimumTime(**test_input) == -1

test_input = { "nums1": [7,2,6,4,9,9,1,9,6,7], "nums2": [0,1,3,2,3,3,4,2,2,1], "x": 58 }
assert my_solution.minimumTime(**test_input) == -1

test_input = { "nums1": [6,8,2,3,9,8,10,9,9], "nums2": [1,4,2,3,2,0,1,1,3], "x": 40 }
assert my_solution.minimumTime(**test_input) == -1

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

test_input = { "nums1": [7,5,8,3,10,2,4,8,7], "nums2": [4,4,2,4,2,3,1,1,1], "x": 49 }
assert my_solution.minimumTime(**test_input) == -1

test_input = { "nums1": [4,7,2,6,9,2], "nums2": [1,2,1,4,1,3], "x": 28 }
assert my_solution.minimumTime(**test_input) == 3

test_input = { "nums1": [3,6,3,9,5], "nums2": [0,4,0,3,1], "x": 23 }
assert my_solution.minimumTime(**test_input) == 1


number-of-employees-who-met-the-target

Number of Employees Who Met the Target

Prompt:
"""
There are n employees in a company, numbered from 0 to n - 1. Each employee i has worked for hours[i] hours in the company.

The company requires each employee to work for at least target hours.

You are given a 0-indexed array of non-negative integers hours of length n and a non-negative integer target.

Return the integer denoting the number of employees who worked at least target hours.

Example 1:

Input: hours = [0,1,2,3,4], target = 2
Output: 3
Explanation: The company wants each employee to work for at least 2 hours.
- Employee 0 worked for 0 hours and didn't meet the target.
- Employee 1 worked for 1 hours and didn't meet the target.
- Employee 2 worked for 2 hours and met the target.
- Employee 3 worked for 3 hours and met the target.
- Employee 4 worked for 4 hours and met the target.
There are 3 employees who met the target.

Example 2:

Input: hours = [5,1,4,2,2], target = 6
Output: 0
Explanation: The company wants each employee to work for at least 6 hours.
There are 0 employees who met the target.

Constraints:

 * 1 <= n == hours.length <= 50
 * 0 <= hours[i], target <= 105
"""
class Solution:
    def numberOfEmployeesWhoMetTarget(self, hours: List[int], target: int) -> int:

There are n employees in a company, numbered from 0 to n - 1. Each employee i has worked for hours[i] hours in the company.

The company requires each employee to work for at least target hours.

You are given a 0-indexed array of non-negative integers hours of length n and a non-negative integer target.

Return the integer denoting the number of employees who worked at least target hours.

Example 1:

Input: hours = [0,1,2,3,4], target = 2
Output: 3
Explanation: The company wants each employee to work for at least 2 hours.
- Employee 0 worked for 0 hours and didn't meet the target.
- Employee 1 worked for 1 hours and didn't meet the target.
- Employee 2 worked for 2 hours and met the target.
- Employee 3 worked for 3 hours and met the target.
- Employee 4 worked for 4 hours and met the target.
There are 3 employees who met the target.

Example 2:

Input: hours = [5,1,4,2,2], target = 6
Output: 0
Explanation: The company wants each employee to work for at least 6 hours.
There are 0 employees who met the target.

Constraints:

 * 1 <= n == hours.length <= 50
 * 0 <= hours[i], target <= 105

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

```

my_solution = Solution()

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

test_input = { "hours": [5,1,4,2,2], "target": 6 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [98], "target": 5 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [19], "target": 13 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [70], "target": 13 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [26], "target": 14 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [2], "target": 16 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [77], "target": 19 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [6], "target": 21 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [27], "target": 21 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [36], "target": 22 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [42], "target": 25 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [70], "target": 27 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [2], "target": 28 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [14], "target": 31 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [45], "target": 34 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [44], "target": 35 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [11], "target": 39 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [71], "target": 39 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [91], "target": 45 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [81], "target": 51 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [15], "target": 52 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [90], "target": 59 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [40], "target": 64 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [12], "target": 69 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [83], "target": 70 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [38], "target": 74 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [18], "target": 78 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [60], "target": 83 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [50], "target": 87 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [75], "target": 92 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [91], "target": 96 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [11], "target": 97 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [48,28], "target": 2 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 2

test_input = { "hours": [38,46], "target": 3 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 2

test_input = { "hours": [30,79], "target": 6 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 2

test_input = { "hours": [45,78], "target": 6 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 2

test_input = { "hours": [20,69], "target": 10 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 2

test_input = { "hours": [82,67], "target": 11 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 2

test_input = { "hours": [29,75], "target": 12 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 2

test_input = { "hours": [97,37], "target": 17 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 2

test_input = { "hours": [42,100], "target": 20 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 2

test_input = { "hours": [11,58], "target": 21 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [12,46], "target": 21 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [70,84], "target": 37 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 2

test_input = { "hours": [7,100], "target": 38 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [47,94], "target": 40 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 2

test_input = { "hours": [18,34], "target": 50 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [47,79], "target": 55 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [74,99], "target": 56 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 2

test_input = { "hours": [53,81], "target": 67 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [36,61], "target": 68 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [48,98], "target": 71 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [71,94], "target": 72 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [60,99], "target": 73 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [12,12], "target": 74 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [100,87], "target": 75 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 2

test_input = { "hours": [12,56], "target": 77 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [15,36], "target": 86 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [53,45], "target": 86 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [4,77], "target": 89 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [23,29], "target": 93 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [76,62,96], "target": 5 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 3

test_input = { "hours": [82,67,33], "target": 5 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 3

test_input = { "hours": [28,96,39], "target": 10 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 3

test_input = { "hours": [42,93,58], "target": 13 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 3

test_input = { "hours": [53,22,48], "target": 13 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 3

test_input = { "hours": [68,81,61], "target": 13 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 3

test_input = { "hours": [68,32,33], "target": 22 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 3

test_input = { "hours": [59,65,70], "target": 26 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 3

test_input = { "hours": [15,43,21], "target": 29 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [40,80,75], "target": 33 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 3

test_input = { "hours": [64,11,73], "target": 34 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 2

test_input = { "hours": [1,74,34], "target": 44 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [96,79,91], "target": 44 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 3

test_input = { "hours": [59,9,9], "target": 48 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [79,48,62], "target": 53 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 2

test_input = { "hours": [58,83,2], "target": 54 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 2

test_input = { "hours": [51,40,12], "target": 57 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [54,2,80], "target": 60 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [92,45,91], "target": 65 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 2

test_input = { "hours": [93,23,46], "target": 67 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [17,60,1], "target": 70 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [9,63,77], "target": 73 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [44,86,37], "target": 73 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [75,37,68], "target": 73 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [33,26,77], "target": 78 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [11,88,27], "target": 79 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [12,48,44], "target": 80 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [19,88,13], "target": 82 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [61,56,67], "target": 82 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [46,24,38], "target": 84 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [93,51,83], "target": 85 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 1

test_input = { "hours": [58,14,83], "target": 87 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [52,33,56], "target": 89 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [34,73,46], "target": 91 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [26,59,55], "target": 94 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [41,89,34], "target": 100 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 0

test_input = { "hours": [9,26,77,55], "target": 0 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 4

test_input = { "hours": [24,79,63,37], "target": 1 }
assert my_solution.numberOfEmployeesWhoMetTarget(**test_input) == 4


count-complete-subarrays-in-an-array

Count Complete Subarrays in an Array

Prompt:
"""
You are given an array nums consisting of positive integers.

We call a subarray of an array complete if the following condition is satisfied:

 * The number of distinct elements in the subarray is equal to the number of distinct elements in the whole array.

Return the number of complete subarrays.

A subarray is a contiguous non-empty part of an array.

Example 1:

Input: nums = [1,3,1,2,2]
Output: 4
Explanation: The complete subarrays are the following: [1,3,1,2], [1,3,1,2,2], [3,1,2] and [3,1,2,2].

Example 2:

Input: nums = [5,5,5,5]
Output: 10
Explanation: The array consists only of the integer 5, so any subarray is complete. The number of subarrays that we can choose is 10.

Constraints:

 * 1 <= nums.length <= 1000
 * 1 <= nums[i] <= 2000
"""
class Solution:
    def countCompleteSubarrays(self, nums: List[int]) -> int:

You are given an array nums consisting of positive integers.

We call a subarray of an array complete if the following condition is satisfied:

 * The number of distinct elements in the subarray is equal to the number of distinct elements in the whole array.

Return the number of complete subarrays.

A subarray is a contiguous non-empty part of an array.

Example 1:

Input: nums = [1,3,1,2,2]
Output: 4
Explanation: The complete subarrays are the following: [1,3,1,2], [1,3,1,2,2], [3,1,2] and [3,1,2,2].

Example 2:

Input: nums = [5,5,5,5]
Output: 10
Explanation: The array consists only of the integer 5, so any subarray is complete. The number of subarrays that we can choose is 10.

Constraints:

 * 1 <= nums.length <= 1000
 * 1 <= nums[i] <= 2000

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

```

my_solution = Solution()

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

test_input = { "nums": [5,5,5,5] }
assert my_solution.countCompleteSubarrays(**test_input) == 10

test_input = { "nums": [459,459,962,1579,1435,756,1872,1597] }
assert my_solution.countCompleteSubarrays(**test_input) == 2

test_input = { "nums": [1786,1786,1786,114] }
assert my_solution.countCompleteSubarrays(**test_input) == 3

test_input = { "nums": [1632,1632,528,359,1671,1632,511,1087,424,1684] }
assert my_solution.countCompleteSubarrays(**test_input) == 3

test_input = { "nums": [1430,12,1430,1075,1722] }
assert my_solution.countCompleteSubarrays(**test_input) == 2

test_input = { "nums": [1917,1917,608,608,1313,751,558,1561,608] }
assert my_solution.countCompleteSubarrays(**test_input) == 4

test_input = { "nums": [254,1690,1690,1068,1779] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

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

test_input = { "nums": [1677,1677,1352,1219,1666,1677,1892,1892,319] }
assert my_solution.countCompleteSubarrays(**test_input) == 3

test_input = { "nums": [1386,1997,1997,574,574,1360,989] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [50,48,1118,540,1248,1984,1698,41,1984,186] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [273,524,40,1323,1323] }
assert my_solution.countCompleteSubarrays(**test_input) == 2

test_input = { "nums": [246,376,828,191,1942,210] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [463,1497,1676,127,1379,17,1075,190] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [765,1370] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [1110,804,1110,839,728,839] }
assert my_solution.countCompleteSubarrays(**test_input) == 4

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

test_input = { "nums": [665,867,954,1411,728,1006,372,1411] }
assert my_solution.countCompleteSubarrays(**test_input) == 2

test_input = { "nums": [1213,1203,1277,369,1277] }
assert my_solution.countCompleteSubarrays(**test_input) == 2

test_input = { "nums": [1898,370,822,1659,1360,128,370,360,261,1898] }
assert my_solution.countCompleteSubarrays(**test_input) == 4

test_input = { "nums": [1881,1446] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [474,315,155,155,1986] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [1389,1817,401,1067,1356,1997] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [1586,1332,1055,1586,1586,1861,892,1445] }
assert my_solution.countCompleteSubarrays(**test_input) == 2

test_input = { "nums": [1601,1601] }
assert my_solution.countCompleteSubarrays(**test_input) == 3

test_input = { "nums": [1417,1417,1160,387,928,1572,1832] }
assert my_solution.countCompleteSubarrays(**test_input) == 2

test_input = { "nums": [1497,1237,1237,946,682,331,742] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [377,377] }
assert my_solution.countCompleteSubarrays(**test_input) == 3

test_input = { "nums": [356,356,356,356,356,315] }
assert my_solution.countCompleteSubarrays(**test_input) == 5

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

test_input = { "nums": [211,211,731,226] }
assert my_solution.countCompleteSubarrays(**test_input) == 2

test_input = { "nums": [1253,188,188,5,1393,1696,1062] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [90,1297,482,482,90,1836,1045,1497,482] }
assert my_solution.countCompleteSubarrays(**test_input) == 4

test_input = { "nums": [1857,273,609,609,1803,1491,223,609,1857,1052] }
assert my_solution.countCompleteSubarrays(**test_input) == 2

test_input = { "nums": [617,1014,679,934,955] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [577,577] }
assert my_solution.countCompleteSubarrays(**test_input) == 3

test_input = { "nums": [1793,997,1082,1411,997,546,224,336,307,336] }
assert my_solution.countCompleteSubarrays(**test_input) == 2

test_input = { "nums": [1150,1150] }
assert my_solution.countCompleteSubarrays(**test_input) == 3

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

test_input = { "nums": [1454,1789,1454] }
assert my_solution.countCompleteSubarrays(**test_input) == 3

test_input = { "nums": [1657,1090,1682,1376,547,547,407,755,1124,1376] }
assert my_solution.countCompleteSubarrays(**test_input) == 2

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

test_input = { "nums": [1673,1584,1584,1055,1971,1122,1086,1692,75] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [722,1427] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [1641,448,1641,1437,448,1406,1437] }
assert my_solution.countCompleteSubarrays(**test_input) == 6

test_input = { "nums": [1440,704,1440,1440,749] }
assert my_solution.countCompleteSubarrays(**test_input) == 2

test_input = { "nums": [832,832] }
assert my_solution.countCompleteSubarrays(**test_input) == 3

test_input = { "nums": [1635,1759,1759,1976,700] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [1577,1674,1745,156,596,1973,1390,156,1497,415] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [1646,1991] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [1613,881,1660,1270,1783,881,773,1783,1229,111] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

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

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

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

test_input = { "nums": [999,701,389,999,409,488,993,999,517,1860] }
assert my_solution.countCompleteSubarrays(**test_input) == 2

test_input = { "nums": [236,596,1263,1563,860,596,1184,575] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [278,338] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

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

test_input = { "nums": [1293,564,614,694,1386,564] }
assert my_solution.countCompleteSubarrays(**test_input) == 2

test_input = { "nums": [681,448] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [1563,558,1778,1404,1973] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [1508,1508,649] }
assert my_solution.countCompleteSubarrays(**test_input) == 2

test_input = { "nums": [1077,445,1947,445,789,789,789,956,1988,189] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [1984,526,30,1205,1691,1984,1241,280,280,1984] }
assert my_solution.countCompleteSubarrays(**test_input) == 6

test_input = { "nums": [1802,1876,1143,1802,1012,1876,1802,1821] }
assert my_solution.countCompleteSubarrays(**test_input) == 3

test_input = { "nums": [1338,901,613,575,613] }
assert my_solution.countCompleteSubarrays(**test_input) == 2

test_input = { "nums": [406,406,242,242,770,1063,1436,1063,1063] }
assert my_solution.countCompleteSubarrays(**test_input) == 6

test_input = { "nums": [1235,1235] }
assert my_solution.countCompleteSubarrays(**test_input) == 3

test_input = { "nums": [1337,1088,1088,892,1209,1269] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [1941,1941] }
assert my_solution.countCompleteSubarrays(**test_input) == 3

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

test_input = { "nums": [1891,1891,1748,1748,923,1748,923,763,1062,1748] }
assert my_solution.countCompleteSubarrays(**test_input) == 4

test_input = { "nums": [1111,503,1980] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [213,1666,469,1675] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [769,1774,1654,928,1204] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [294,294,294,294,1351,294,1351,62,585] }
assert my_solution.countCompleteSubarrays(**test_input) == 6

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

test_input = { "nums": [21,1549,21,1549,1998,1219,1549,1021] }
assert my_solution.countCompleteSubarrays(**test_input) == 3

test_input = { "nums": [1124,1124,556,1322,556] }
assert my_solution.countCompleteSubarrays(**test_input) == 4

test_input = { "nums": [908,908,863,1977,908,8,427,1322] }
assert my_solution.countCompleteSubarrays(**test_input) == 3

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

test_input = { "nums": [517,1497,334,334,996,1497,1394,534] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [564,750,750,750,1965,1965,1402] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [403,1080,365,1962,1589,1740,1335,1335,1589] }
assert my_solution.countCompleteSubarrays(**test_input) == 3

test_input = { "nums": [1712,1621,1295,522,1734,522,1371,1935,684] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [270,1443,807,1704,1487] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [1880,1880,1880,604,1634,1412,1880,67,1759,1488] }
assert my_solution.countCompleteSubarrays(**test_input) == 4

test_input = { "nums": [540,1799,1784,1799,972,1786,1578,1480,178,532] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [1235,471,367] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [1887,1373,190,1764,1764,959,959,1373,17] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [1313,910,1172,1541,1758,140,1380,492,240,1664] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [381,1304,381,758,1304,381,758] }
assert my_solution.countCompleteSubarrays(**test_input) == 14

test_input = { "nums": [1517,665] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [1555,223,379,223,379,1982] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [1268,1268,1268,1268] }
assert my_solution.countCompleteSubarrays(**test_input) == 10

test_input = { "nums": [1051,266,266,94,761,1051,255] }
assert my_solution.countCompleteSubarrays(**test_input) == 3

test_input = { "nums": [420,945,3,172] }
assert my_solution.countCompleteSubarrays(**test_input) == 1

test_input = { "nums": [1045,1120,1045,511,1045,1777,1224,336,560,153] }
assert my_solution.countCompleteSubarrays(**test_input) == 2

test_input = { "nums": [627,592,592,1416,370,229,526,633] }
assert my_solution.countCompleteSubarrays(**test_input) == 1


shortest-string-that-contains-three-strings

Shortest String That Contains Three Strings

Prompt:
"""
Given three strings a, b, and c, your task is to find a string that has the minimum length and contains all three strings as substrings.

If there are multiple such strings, return the lexicographically smallest one.

Return a string denoting the answer to the problem.

Notes

 * A string a is lexicographically smaller than a string b (of the same length) if in the first position where a and b differ, string a has a letter that appears earlier in the alphabet than the corresponding letter in b.
 * A substring is a contiguous sequence of characters within a string.

Example 1:

Input: a = "abc", b = "bca", c = "aaa"
Output: "aaabca"
Explanation:  We show that "aaabca" contains all the given strings: a = ans[2...4], b = ans[3..5], c = ans[0..2]. It can be shown that the length of the resulting string would be at least 6 and "aaabca" is the lexicographically smallest one.

Example 2:

Input: a = "ab", b = "ba", c = "aba"
Output: "aba"
Explanation: We show that the string "aba" contains all the given strings: a = ans[0..1], b = ans[1..2], c = ans[0..2]. Since the length of c is 3, the length of the resulting string would be at least 3. It can be shown that "aba" is the lexicographically smallest one.

Constraints:

 * 1 <= a.length, b.length, c.length <= 100
 * a, b, c consist only of lowercase English letters.
"""
class Solution:
    def minimumString(self, a: str, b: str, c: str) -> str:

Given three strings a, b, and c, your task is to find a string that has the minimum length and contains all three strings as substrings.

If there are multiple such strings, return the lexicographically smallest one.

Return a string denoting the answer to the problem.

Notes

 * A string a is lexicographically smaller than a string b (of the same length) if in the first position where a and b differ, string a has a letter that appears earlier in the alphabet than the corresponding letter in b.
 * A substring is a contiguous sequence of characters within a string.

Example 1:

Input: a = "abc", b = "bca", c = "aaa"
Output: "aaabca"
Explanation:  We show that "aaabca" contains all the given strings: a = ans[2...4], b = ans[3..5], c = ans[0..2]. It can be shown that the length of the resulting string would be at least 6 and "aaabca" is the lexicographically smallest one.

Example 2:

Input: a = "ab", b = "ba", c = "aba"
Output: "aba"
Explanation: We show that the string "aba" contains all the given strings: a = ans[0..1], b = ans[1..2], c = ans[0..2]. Since the length of c is 3, the length of the resulting string would be at least 3. It can be shown that "aba" is the lexicographically smallest one.

Constraints:

 * 1 <= a.length, b.length, c.length <= 100
 * a, b, c consist only of lowercase English letters.

Please complete the code below to solve above prblem:
```python
class Solution:
    def minimumString(self, a: str, b: str, c: str) -> str:

```

my_solution = Solution()

test_input = { "a": "abc", "b": "bca", "c": "aaa" }
assert my_solution.minimumString(**test_input) == "aaabca"

test_input = { "a": "ab", "b": "ba", "c": "aba" }
assert my_solution.minimumString(**test_input) == "aba"

test_input = { "a": "xyyyz", "b": "xzyz", "c": "zzz" }
assert my_solution.minimumString(**test_input) == "xyyyzxzyzzz"

test_input = { "a": "a", "b": "a", "c": "a" }
assert my_solution.minimumString(**test_input) == "a"

test_input = { "a": "a", "b": "a", "c": "b" }
assert my_solution.minimumString(**test_input) == "ab"

test_input = { "a": "a", "b": "c", "c": "a" }
assert my_solution.minimumString(**test_input) == "ac"

test_input = { "a": "a", "b": "b", "c": "b" }
assert my_solution.minimumString(**test_input) == "ab"

test_input = { "a": "a", "b": "a", "c": "c" }
assert my_solution.minimumString(**test_input) == "ac"

test_input = { "a": "a", "b": "c", "c": "b" }
assert my_solution.minimumString(**test_input) == "abc"

test_input = { "a": "c", "b": "c", "c": "a" }
assert my_solution.minimumString(**test_input) == "ac"

test_input = { "a": "k", "b": "e", "c": "a" }
assert my_solution.minimumString(**test_input) == "aek"

test_input = { "a": "a", "b": "b", "c": "a" }
assert my_solution.minimumString(**test_input) == "ab"

test_input = { "a": "b", "b": "b", "c": "a" }
assert my_solution.minimumString(**test_input) == "ab"

test_input = { "a": "b", "b": "b", "c": "b" }
assert my_solution.minimumString(**test_input) == "b"

test_input = { "a": "b", "b": "b", "c": "c" }
assert my_solution.minimumString(**test_input) == "bc"

test_input = { "a": "c", "b": "b", "c": "b" }
assert my_solution.minimumString(**test_input) == "bc"

test_input = { "a": "b", "b": "c", "c": "c" }
assert my_solution.minimumString(**test_input) == "bc"

test_input = { "a": "b", "b": "c", "c": "a" }
assert my_solution.minimumString(**test_input) == "abc"

test_input = { "a": "c", "b": "a", "c": "c" }
assert my_solution.minimumString(**test_input) == "ac"

test_input = { "a": "c", "b": "b", "c": "c" }
assert my_solution.minimumString(**test_input) == "bc"

test_input = { "a": "c", "b": "c", "c": "c" }
assert my_solution.minimumString(**test_input) == "c"

test_input = { "a": "e", "b": "k", "c": "y" }
assert my_solution.minimumString(**test_input) == "eky"

test_input = { "a": "z", "b": "p", "c": "m" }
assert my_solution.minimumString(**test_input) == "mpz"

test_input = { "a": "a", "b": "aa", "c": "a" }
assert my_solution.minimumString(**test_input) == "aa"

test_input = { "a": "ac", "b": "a", "c": "a" }
assert my_solution.minimumString(**test_input) == "ac"

test_input = { "a": "ca", "b": "a", "c": "a" }
assert my_solution.minimumString(**test_input) == "ca"

test_input = { "a": "a", "b": "cc", "c": "a" }
assert my_solution.minimumString(**test_input) == "acc"

test_input = { "a": "a", "b": "a", "c": "aa" }
assert my_solution.minimumString(**test_input) == "aa"

test_input = { "a": "c", "b": "a", "c": "aa" }
assert my_solution.minimumString(**test_input) == "aac"

test_input = { "a": "a", "b": "ab", "c": "a" }
assert my_solution.minimumString(**test_input) == "ab"

test_input = { "a": "ab", "b": "b", "c": "a" }
assert my_solution.minimumString(**test_input) == "ab"

test_input = { "a": "ab", "b": "a", "c": "c" }
assert my_solution.minimumString(**test_input) == "abc"

test_input = { "a": "c", "b": "ac", "c": "a" }
assert my_solution.minimumString(**test_input) == "ac"

test_input = { "a": "ab", "b": "a", "c": "b" }
assert my_solution.minimumString(**test_input) == "ab"

test_input = { "a": "b", "b": "a", "c": "ba" }
assert my_solution.minimumString(**test_input) == "ba"

test_input = { "a": "ba", "b": "a", "c": "a" }
assert my_solution.minimumString(**test_input) == "ba"

test_input = { "a": "b", "b": "ba", "c": "a" }
assert my_solution.minimumString(**test_input) == "ba"

test_input = { "a": "a", "b": "bc", "c": "a" }
assert my_solution.minimumString(**test_input) == "abc"

test_input = { "a": "c", "b": "a", "c": "bc" }
assert my_solution.minimumString(**test_input) == "abc"

test_input = { "a": "a", "b": "c", "c": "ab" }
assert my_solution.minimumString(**test_input) == "abc"

test_input = { "a": "c", "b": "a", "c": "ac" }
assert my_solution.minimumString(**test_input) == "ac"

test_input = { "a": "a", "b": "c", "c": "ca" }
assert my_solution.minimumString(**test_input) == "ca"

test_input = { "a": "c", "b": "a", "c": "cc" }
assert my_solution.minimumString(**test_input) == "acc"

test_input = { "a": "a", "b": "ca", "c": "a" }
assert my_solution.minimumString(**test_input) == "ca"

test_input = { "a": "a", "b": "cc", "c": "c" }
assert my_solution.minimumString(**test_input) == "acc"

test_input = { "a": "aa", "b": "a", "c": "a" }
assert my_solution.minimumString(**test_input) == "aa"

test_input = { "a": "aa", "b": "b", "c": "a" }
assert my_solution.minimumString(**test_input) == "aab"

test_input = { "a": "a", "b": "aa", "c": "c" }
assert my_solution.minimumString(**test_input) == "aac"

test_input = { "a": "b", "b": "c", "c": "aa" }
assert my_solution.minimumString(**test_input) == "aabc"

test_input = { "a": "b", "b": "b", "c": "ab" }
assert my_solution.minimumString(**test_input) == "ab"

test_input = { "a": "ab", "b": "b", "c": "c" }
assert my_solution.minimumString(**test_input) == "abc"

test_input = { "a": "ac", "b": "c", "c": "b" }
assert my_solution.minimumString(**test_input) == "acb"

test_input = { "a": "c", "b": "c", "c": "ac" }
assert my_solution.minimumString(**test_input) == "ac"

test_input = { "a": "ba", "b": "b", "c": "a" }
assert my_solution.minimumString(**test_input) == "ba"

test_input = { "a": "a", "b": "b", "c": "ca" }
assert my_solution.minimumString(**test_input) == "bca"

test_input = { "a": "b", "b": "a", "c": "aa" }
assert my_solution.minimumString(**test_input) == "aab"

test_input = { "a": "b", "b": "b", "c": "aa" }
assert my_solution.minimumString(**test_input) == "aab"

test_input = { "a": "b", "b": "ab", "c": "a" }
assert my_solution.minimumString(**test_input) == "ab"

test_input = { "a": "b", "b": "ab", "c": "b" }
assert my_solution.minimumString(**test_input) == "ab"

test_input = { "a": "ac", "b": "b", "c": "a" }
assert my_solution.minimumString(**test_input) == "acb"

test_input = { "a": "b", "b": "b", "c": "ac" }
assert my_solution.minimumString(**test_input) == "acb"

test_input = { "a": "bb", "b": "b", "c": "b" }
assert my_solution.minimumString(**test_input) == "bb"

test_input = { "a": "b", "b": "bc", "c": "b" }
assert my_solution.minimumString(**test_input) == "bc"

test_input = { "a": "b", "b": "b", "c": "ca" }
assert my_solution.minimumString(**test_input) == "bca"

test_input = { "a": "cb", "b": "b", "c": "b" }
assert my_solution.minimumString(**test_input) == "cb"

test_input = { "a": "b", "b": "b", "c": "bb" }
assert my_solution.minimumString(**test_input) == "bb"

test_input = { "a": "b", "b": "a", "c": "bc" }
assert my_solution.minimumString(**test_input) == "abc"

test_input = { "a": "b", "b": "bc", "c": "c" }
assert my_solution.minimumString(**test_input) == "bc"

test_input = { "a": "b", "b": "ab", "c": "c" }
assert my_solution.minimumString(**test_input) == "abc"

test_input = { "a": "b", "b": "bb", "c": "c" }
assert my_solution.minimumString(**test_input) == "bbc"

test_input = { "a": "c", "b": "b", "c": "bc" }
assert my_solution.minimumString(**test_input) == "bc"

test_input = { "a": "b", "b": "cb", "c": "c" }
assert my_solution.minimumString(**test_input) == "cb"

test_input = { "a": "b", "b": "cc", "c": "c" }
assert my_solution.minimumString(**test_input) == "bcc"

test_input = { "a": "b", "b": "cb", "c": "a" }
assert my_solution.minimumString(**test_input) == "acb"

test_input = { "a": "b", "b": "b", "c": "cb" }
assert my_solution.minimumString(**test_input) == "cb"

test_input = { "a": "c", "b": "b", "c": "cb" }
assert my_solution.minimumString(**test_input) == "cb"

test_input = { "a": "a", "b": "ba", "c": "b" }
assert my_solution.minimumString(**test_input) == "ba"

test_input = { "a": "ba", "b": "a", "c": "b" }
assert my_solution.minimumString(**test_input) == "ba"

test_input = { "a": "ba", "b": "b", "c": "b" }
assert my_solution.minimumString(**test_input) == "ba"

test_input = { "a": "b", "b": "ba", "c": "c" }
assert my_solution.minimumString(**test_input) == "bac"

test_input = { "a": "c", "b": "ba", "c": "b" }
assert my_solution.minimumString(**test_input) == "bac"

test_input = { "a": "c", "b": "c", "c": "ba" }
assert my_solution.minimumString(**test_input) == "bac"

test_input = { "a": "bb", "b": "a", "c": "b" }
assert my_solution.minimumString(**test_input) == "abb"

test_input = { "a": "b", "b": "bb", "c": "b" }
assert my_solution.minimumString(**test_input) == "bb"

test_input = { "a": "c", "b": "bb", "c": "b" }
assert my_solution.minimumString(**test_input) == "bbc"

test_input = { "a": "a", "b": "bc", "c": "b" }
assert my_solution.minimumString(**test_input) == "abc"

test_input = { "a": "bc", "b": "b", "c": "c" }
assert my_solution.minimumString(**test_input) == "bc"

test_input = { "a": "bc", "b": "c", "c": "b" }
assert my_solution.minimumString(**test_input) == "bc"

test_input = { "a": "bc", "b": "c", "c": "c" }
assert my_solution.minimumString(**test_input) == "bc"

test_input = { "a": "ac", "b": "a", "c": "c" }
assert my_solution.minimumString(**test_input) == "ac"

test_input = { "a": "c", "b": "c", "c": "aa" }
assert my_solution.minimumString(**test_input) == "aac"

test_input = { "a": "cb", "b": "b", "c": "c" }
assert my_solution.minimumString(**test_input) == "cb"

test_input = { "a": "c", "b": "b", "c": "cc" }
assert my_solution.minimumString(**test_input) == "bcc"

test_input = { "a": "ba", "b": "b", "c": "c" }
assert my_solution.minimumString(**test_input) == "bac"

test_input = { "a": "aa", "b": "c", "c": "c" }
assert my_solution.minimumString(**test_input) == "aac"

test_input = { "a": "c", "b": "bc", "c": "c" }
assert my_solution.minimumString(**test_input) == "bc"

test_input = { "a": "c", "b": "ca", "c": "c" }
assert my_solution.minimumString(**test_input) == "ca"

test_input = { "a": "c", "b": "cb", "c": "c" }
assert my_solution.minimumString(**test_input) == "cb"

test_input = { "a": "c", "b": "c", "c": "cc" }
assert my_solution.minimumString(**test_input) == "cc"

test_input = { "a": "ca", "b": "c", "c": "a" }
assert my_solution.minimumString(**test_input) == "ca"


count-stepping-numbers-in-range

Count Stepping Numbers in Range

Prompt:
"""
Given two positive integers low and high represented as strings, find the count of stepping numbers in the inclusive range [low, high].

A stepping number is an integer such that all of its adjacent digits have an absolute difference of exactly 1.

Return an integer denoting the count of stepping numbers in the inclusive range [low, high].

Since the answer may be very large, return it modulo 109 + 7.

Note: A stepping number should not have a leading zero.

Example 1:

Input: low = "1", high = "11"
Output: 10
Explanation: The stepping numbers in the range [1,11] are 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10. There are a total of 10 stepping numbers in the range. Hence, the output is 10.

Example 2:

Input: low = "90", high = "101"
Output: 2
Explanation: The stepping numbers in the range [90,101] are 98 and 101. There are a total of 2 stepping numbers in the range. Hence, the output is 2.

Constraints:

 * 1 <= int(low) <= int(high) < 10100
 * 1 <= low.length, high.length <= 100
 * low and high consist of only digits.
 * low and high don't have any leading zeros.
"""
class Solution:
    def countSteppingNumbers(self, low: str, high: str) -> int:

Given two positive integers low and high represented as strings, find the count of stepping numbers in the inclusive range [low, high].

A stepping number is an integer such that all of its adjacent digits have an absolute difference of exactly 1.

Return an integer denoting the count of stepping numbers in the inclusive range [low, high].

Since the answer may be very large, return it modulo 109 + 7.

Note: A stepping number should not have a leading zero.

Example 1:

Input: low = "1", high = "11"
Output: 10
Explanation: The stepping numbers in the range [1,11] are 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10. There are a total of 10 stepping numbers in the range. Hence, the output is 10.

Example 2:

Input: low = "90", high = "101"
Output: 2
Explanation: The stepping numbers in the range [90,101] are 98 and 101. There are a total of 2 stepping numbers in the range. Hence, the output is 2.

Constraints:

 * 1 <= int(low) <= int(high) < 10100
 * 1 <= low.length, high.length <= 100
 * low and high consist of only digits.
 * low and high don't have any leading zeros.

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

```

my_solution = Solution()

test_input = { "low": "1", "high": "11" }
assert my_solution.countSteppingNumbers(**test_input) == 10

test_input = { "low": "90", "high": "101" }
assert my_solution.countSteppingNumbers(**test_input) == 2

test_input = { "low": "2", "high": "40" }
assert my_solution.countSteppingNumbers(**test_input) == 14

test_input = { "low": "26", "high": "60" }
assert my_solution.countSteppingNumbers(**test_input) == 6

test_input = { "low": "40", "high": "70" }
assert my_solution.countSteppingNumbers(**test_input) == 6

test_input = { "low": "46", "high": "66" }
assert my_solution.countSteppingNumbers(**test_input) == 3

test_input = { "low": "58", "high": "58" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "23", "high": "99" }
assert my_solution.countSteppingNumbers(**test_input) == 14

test_input = { "low": "44", "high": "86" }
assert my_solution.countSteppingNumbers(**test_input) == 7

test_input = { "low": "20", "high": "111" }
assert my_solution.countSteppingNumbers(**test_input) == 16

test_input = { "low": "70", "high": "75" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "37", "high": "111" }
assert my_solution.countSteppingNumbers(**test_input) == 12

test_input = { "low": "17", "high": "149" }
assert my_solution.countSteppingNumbers(**test_input) == 18

test_input = { "low": "21", "high": "145" }
assert my_solution.countSteppingNumbers(**test_input) == 18

test_input = { "low": "47", "high": "124" }
assert my_solution.countSteppingNumbers(**test_input) == 12

test_input = { "low": "81", "high": "91" }
assert my_solution.countSteppingNumbers(**test_input) == 2

test_input = { "low": "18", "high": "159" }
assert my_solution.countSteppingNumbers(**test_input) == 18

test_input = { "low": "85", "high": "92" }
assert my_solution.countSteppingNumbers(**test_input) == 2

test_input = { "low": "66", "high": "112" }
assert my_solution.countSteppingNumbers(**test_input) == 7

test_input = { "low": "84", "high": "102" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "41", "high": "156" }
assert my_solution.countSteppingNumbers(**test_input) == 14

test_input = { "low": "64", "high": "135" }
assert my_solution.countSteppingNumbers(**test_input) == 10

test_input = { "low": "57", "high": "143" }
assert my_solution.countSteppingNumbers(**test_input) == 10

test_input = { "low": "85", "high": "116" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "103", "high": "104" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "98", "high": "118" }
assert my_solution.countSteppingNumbers(**test_input) == 2

test_input = { "low": "28", "high": "197" }
assert my_solution.countSteppingNumbers(**test_input) == 16

test_input = { "low": "6", "high": "220" }
assert my_solution.countSteppingNumbers(**test_input) == 26

test_input = { "low": "106", "high": "121" }
assert my_solution.countSteppingNumbers(**test_input) == 1

test_input = { "low": "7", "high": "226" }
assert my_solution.countSteppingNumbers(**test_input) == 25

test_input = { "low": "105", "high": "136" }
assert my_solution.countSteppingNumbers(**test_input) == 2

test_input = { "low": "30", "high": "221" }
assert my_solution.countSteppingNumbers(**test_input) == 18

test_input = { "low": "113", "high": "139" }
assert my_solution.countSteppingNumbers(**test_input) == 2

test_input = { "low": "44", "high": "210" }
assert my_solution.countSteppingNumbers(**test_input) == 14

test_input = { "low": "13", "high": "242" }
assert my_solution.countSteppingNumbers(**test_input) == 22

test_input = { "low": "12", "high": "257" }
assert my_solution.countSteppingNumbers(**test_input) == 23

test_input = { "low": "70", "high": "205" }
assert my_solution.countSteppingNumbers(**test_input) == 8

test_input = { "low": "55", "high": "229" }
assert my_solution.countSteppingNumbers(**test_input) == 13

test_input = { "low": "16", "high": "276" }
assert my_solution.countSteppingNumbers(**test_input) == 22

test_input = { "low": "140", "high": "153" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "79", "high": "218" }
assert my_solution.countSteppingNumbers(**test_input) == 8

test_input = { "low": "99", "high": "200" }
assert my_solution.countSteppingNumbers(**test_input) == 3

test_input = { "low": "90", "high": "210" }
assert my_solution.countSteppingNumbers(**test_input) == 5

test_input = { "low": "123", "high": "186" }
assert my_solution.countSteppingNumbers(**test_input) == 1

test_input = { "low": "149", "high": "160" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "138", "high": "180" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "160", "high": "163" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "79", "high": "246" }
assert my_solution.countSteppingNumbers(**test_input) == 10

test_input = { "low": "137", "high": "189" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "163", "high": "163" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "37", "high": "289" }
assert my_solution.countSteppingNumbers(**test_input) == 18

test_input = { "low": "79", "high": "255" }
assert my_solution.countSteppingNumbers(**test_input) == 10

test_input = { "low": "140", "high": "197" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "22", "high": "317" }
assert my_solution.countSteppingNumbers(**test_input) == 21

test_input = { "low": "146", "high": "199" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "57", "high": "288" }
assert my_solution.countSteppingNumbers(**test_input) == 14

test_input = { "low": "109", "high": "237" }
assert my_solution.countSteppingNumbers(**test_input) == 6

test_input = { "low": "48", "high": "299" }
assert my_solution.countSteppingNumbers(**test_input) == 16

test_input = { "low": "158", "high": "194" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "29", "high": "326" }
assert my_solution.countSteppingNumbers(**test_input) == 22

test_input = { "low": "133", "high": "223" }
assert my_solution.countSteppingNumbers(**test_input) == 2

test_input = { "low": "109", "high": "249" }
assert my_solution.countSteppingNumbers(**test_input) == 6

test_input = { "low": "20", "high": "341" }
assert my_solution.countSteppingNumbers(**test_input) == 24

test_input = { "low": "9", "high": "352" }
assert my_solution.countSteppingNumbers(**test_input) == 29

test_input = { "low": "115", "high": "253" }
assert my_solution.countSteppingNumbers(**test_input) == 6

test_input = { "low": "181", "high": "188" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "120", "high": "250" }
assert my_solution.countSteppingNumbers(**test_input) == 6

test_input = { "low": "100", "high": "273" }
assert my_solution.countSteppingNumbers(**test_input) == 7

test_input = { "low": "105", "high": "269" }
assert my_solution.countSteppingNumbers(**test_input) == 6

test_input = { "low": "189", "high": "190" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "148", "high": "237" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "126", "high": "267" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "141", "high": "252" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "185", "high": "209" }
assert my_solution.countSteppingNumbers(**test_input) == 0

test_input = { "low": "14", "high": "381" }
assert my_solution.countSteppingNumbers(**test_input) == 26

test_input = { "low": "7", "high": "388" }
assert my_solution.countSteppingNumbers(**test_input) == 31

test_input = { "low": "15", "high": "383" }
assert my_solution.countSteppingNumbers(**test_input) == 26

test_input = { "low": "78", "high": "325" }
assert my_solution.countSteppingNumbers(**test_input) == 13

test_input = { "low": "131", "high": "274" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "177", "high": "230" }
assert my_solution.countSteppingNumbers(**test_input) == 2

test_input = { "low": "66", "high": "346" }
assert my_solution.countSteppingNumbers(**test_input) == 17

test_input = { "low": "144", "high": "271" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "96", "high": "322" }
assert my_solution.countSteppingNumbers(**test_input) == 9

test_input = { "low": "112", "high": "307" }
assert my_solution.countSteppingNumbers(**test_input) == 6

test_input = { "low": "73", "high": "349" }
assert my_solution.countSteppingNumbers(**test_input) == 16

test_input = { "low": "128", "high": "296" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "189", "high": "237" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "141", "high": "286" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "47", "high": "382" }
assert my_solution.countSteppingNumbers(**test_input) == 20

test_input = { "low": "27", "high": "411" }
assert my_solution.countSteppingNumbers(**test_input) == 24

test_input = { "low": "16", "high": "423" }
assert my_solution.countSteppingNumbers(**test_input) == 26

test_input = { "low": "22", "high": "417" }
assert my_solution.countSteppingNumbers(**test_input) == 25

test_input = { "low": "174", "high": "266" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "101", "high": "342" }
assert my_solution.countSteppingNumbers(**test_input) == 9

test_input = { "low": "76", "high": "370" }
assert my_solution.countSteppingNumbers(**test_input) == 16

test_input = { "low": "147", "high": "301" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "72", "high": "376" }
assert my_solution.countSteppingNumbers(**test_input) == 16

test_input = { "low": "154", "high": "297" }
assert my_solution.countSteppingNumbers(**test_input) == 4

test_input = { "low": "15", "high": "439" }
assert my_solution.countSteppingNumbers(**test_input) == 28

test_input = { "low": "73", "high": "381" }
assert my_solution.countSteppingNumbers(**test_input) == 16