divide-an-array-into-subarrays-with-minimum-cost-ii

Divide an Array Into Subarrays With Minimum Cost II

Prompt:
"""
You are given a 0-indexed array of integers nums of length n, and two positive integers k and dist.
The cost of an array is the value of its first element. For example, the cost of [1,2,3] is 1 while the cost of [3,4,1] is 3.
You need to divide nums into k disjoint contiguous subarrays, such that the difference between the starting index of the second subarray and the starting index of the kth subarray should be less than or equal to dist. In other words, if you divide nums into the subarrays nums[0..(i1 - 1)], nums[i1..(i2 - 1)], ..., nums[ik-1..(n - 1)], then ik-1 - i1 <= dist.
Return the minimum possible sum of the cost of these subarrays.

Example 1:

Input: nums = [1,3,2,6,4,2], k = 3, dist = 3
Output: 5
Explanation: The best possible way to divide nums into 3 subarrays is: [1,3], [2,6,4], and [2]. This choice is valid because ik-1 - i1 is 5 - 2 = 3 which is equal to dist. The total cost is nums[0] + nums[2] + nums[5] which is 1 + 2 + 2 = 5.
It can be shown that there is no possible way to divide nums into 3 subarrays at a cost lower than 5.

Example 2:

Input: nums = [10,1,2,2,2,1], k = 4, dist = 3
Output: 15
Explanation: The best possible way to divide nums into 4 subarrays is: [10], [1], [2], and [2,2,1]. This choice is valid because ik-1 - i1 is 3 - 1 = 2 which is less than dist. The total cost is nums[0] + nums[1] + nums[2] + nums[3] which is 10 + 1 + 2 + 2 = 15.
The division [10], [1], [2,2,2], and [1] is not valid, because the difference between ik-1 and i1 is 5 - 1 = 4, which is greater than dist.
It can be shown that there is no possible way to divide nums into 4 subarrays at a cost lower than 15.

Example 3:

Input: nums = [10,8,18,9], k = 3, dist = 1
Output: 36
Explanation: The best possible way to divide nums into 4 subarrays is: [10], [8], and [18,9]. This choice is valid because ik-1 - i1 is 2 - 1 = 1 which is equal to dist.The total cost is nums[0] + nums[1] + nums[2] which is 10 + 8 + 18 = 36.
The division [10], [8,18], and [9] is not valid, because the difference between ik-1 and i1 is 3 - 1 = 2, which is greater than dist.
It can be shown that there is no possible way to divide nums into 3 subarrays at a cost lower than 36.

Constraints:

3 <= n <= 105
1 <= nums[i] <= 109
3 <= k <= n
k - 2 <= dist <= n - 2
"""
class Solution:
    def minimumCost(self, nums: List[int], k: int, dist: int) -> int:

You are given a 0-indexed array of integers nums of length n, and two positive integers k and dist.
The cost of an array is the value of its first element. For example, the cost of [1,2,3] is 1 while the cost of [3,4,1] is 3.
You need to divide nums into k disjoint contiguous subarrays, such that the difference between the starting index of the second subarray and the starting index of the kth subarray should be less than or equal to dist. In other words, if you divide nums into the subarrays nums[0..(i1 - 1)], nums[i1..(i2 - 1)], ..., nums[ik-1..(n - 1)], then ik-1 - i1 <= dist.
Return the minimum possible sum of the cost of these subarrays.

Example 1:

Input: nums = [1,3,2,6,4,2], k = 3, dist = 3
Output: 5
Explanation: The best possible way to divide nums into 3 subarrays is: [1,3], [2,6,4], and [2]. This choice is valid because ik-1 - i1 is 5 - 2 = 3 which is equal to dist. The total cost is nums[0] + nums[2] + nums[5] which is 1 + 2 + 2 = 5.
It can be shown that there is no possible way to divide nums into 3 subarrays at a cost lower than 5.

Example 2:

Input: nums = [10,1,2,2,2,1], k = 4, dist = 3
Output: 15
Explanation: The best possible way to divide nums into 4 subarrays is: [10], [1], [2], and [2,2,1]. This choice is valid because ik-1 - i1 is 3 - 1 = 2 which is less than dist. The total cost is nums[0] + nums[1] + nums[2] + nums[3] which is 10 + 1 + 2 + 2 = 15.
The division [10], [1], [2,2,2], and [1] is not valid, because the difference between ik-1 and i1 is 5 - 1 = 4, which is greater than dist.
It can be shown that there is no possible way to divide nums into 4 subarrays at a cost lower than 15.

Example 3:

Input: nums = [10,8,18,9], k = 3, dist = 1
Output: 36
Explanation: The best possible way to divide nums into 4 subarrays is: [10], [8], and [18,9]. This choice is valid because ik-1 - i1 is 2 - 1 = 1 which is equal to dist.The total cost is nums[0] + nums[1] + nums[2] which is 10 + 8 + 18 = 36.
The division [10], [8,18], and [9] is not valid, because the difference between ik-1 and i1 is 3 - 1 = 2, which is greater than dist.
It can be shown that there is no possible way to divide nums into 3 subarrays at a cost lower than 36.

Constraints:

3 <= n <= 105
1 <= nums[i] <= 109
3 <= k <= n
k - 2 <= dist <= n - 2

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

```

my_solution = Solution()

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

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

test_input = { "nums": [10,8,18,9], "k": 3, "dist": 1 }
assert my_solution.minimumCost(**test_input) == 36

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

test_input = { "nums": [50,50,50], "k": 3, "dist": 1 }
assert my_solution.minimumCost(**test_input) == 150

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

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

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

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

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

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

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

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

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

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

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

test_input = { "nums": [1,8,3,8], "k": 3, "dist": 1 }
assert my_solution.minimumCost(**test_input) == 12

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

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

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

test_input = { "nums": [2,5,4,8], "k": 4, "dist": 2 }
assert my_solution.minimumCost(**test_input) == 19

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

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

test_input = { "nums": [2,6,4,5], "k": 4, "dist": 2 }
assert my_solution.minimumCost(**test_input) == 17

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

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

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

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

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

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

test_input = { "nums": [2,8,4,5], "k": 4, "dist": 2 }
assert my_solution.minimumCost(**test_input) == 19

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

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

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

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

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

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

test_input = { "nums": [3,6,3,8], "k": 3, "dist": 1 }
assert my_solution.minimumCost(**test_input) == 12

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

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

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

test_input = { "nums": [3,7,3,6], "k": 3, "dist": 1 }
assert my_solution.minimumCost(**test_input) == 12

test_input = { "nums": [3,7,3,8], "k": 3, "dist": 2 }
assert my_solution.minimumCost(**test_input) == 13

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

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

test_input = { "nums": [3,8,4,6], "k": 4, "dist": 2 }
assert my_solution.minimumCost(**test_input) == 21

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

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

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

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

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

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

test_input = { "nums": [4,6,4,5], "k": 4, "dist": 2 }
assert my_solution.minimumCost(**test_input) == 19

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

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

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

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

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

test_input = { "nums": [4,8,3,6], "k": 3, "dist": 1 }
assert my_solution.minimumCost(**test_input) == 13

test_input = { "nums": [4,8,3,7], "k": 3, "dist": 2 }
assert my_solution.minimumCost(**test_input) == 14

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

test_input = { "nums": [4,8,4,8], "k": 4, "dist": 2 }
assert my_solution.minimumCost(**test_input) == 24

test_input = { "nums": [1,5,6,6,3,7,2], "k": 6, "dist": 5 }
assert my_solution.minimumCost(**test_input) == 23

test_input = { "nums": [1,6,4,6,2,9,11], "k": 4, "dist": 3 }
assert my_solution.minimumCost(**test_input) == 13

test_input = { "nums": [1,6,4,7,9,6,1], "k": 4, "dist": 4 }
assert my_solution.minimumCost(**test_input) == 12

test_input = { "nums": [1,6,5,6,4,9,11], "k": 5, "dist": 5 }
assert my_solution.minimumCost(**test_input) == 22

test_input = { "nums": [1,6,5,7,8,7,5], "k": 5, "dist": 4 }
assert my_solution.minimumCost(**test_input) == 25

test_input = { "nums": [1,6,5,8,11,10,6], "k": 5, "dist": 3 }
assert my_solution.minimumCost(**test_input) == 31

test_input = { "nums": [1,6,6,8,4,8,7], "k": 6, "dist": 4 }
assert my_solution.minimumCost(**test_input) == 33

test_input = { "nums": [1,7,6,8,5,10,10], "k": 6, "dist": 5 }
assert my_solution.minimumCost(**test_input) == 37

test_input = { "nums": [1,8,3,8,11,11,10], "k": 3, "dist": 5 }
assert my_solution.minimumCost(**test_input) == 12

test_input = { "nums": [1,8,4,7,11,1,8], "k": 4, "dist": 4 }
assert my_solution.minimumCost(**test_input) == 13

test_input = { "nums": [1,8,6,5,6,12,12], "k": 6, "dist": 5 }
assert my_solution.minimumCost(**test_input) == 38

test_input = { "nums": [1,8,6,6,12,5,2], "k": 6, "dist": 5 }
assert my_solution.minimumCost(**test_input) == 28

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

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


count-elements-with-maximum-frequency

Count Elements With Maximum Frequency

Prompt:
"""
You are given an array nums consisting of positive integers.
Return the total frequencies of elements in numssuch that those elements all have the maximum frequency.
The frequency of an element is the number of occurrences of that element in the array.

Example 1:

Input: nums = [1,2,2,3,1,4]
Output: 4
Explanation: The elements 1 and 2 have a frequency of 2 which is the maximum frequency in the array.
So the number of elements in the array with maximum frequency is 4.

Example 2:

Input: nums = [1,2,3,4,5]
Output: 5
Explanation: All elements of the array have a frequency of 1 which is the maximum.
So the number of elements in the array with maximum frequency is 5.

Constraints:

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

You are given an array nums consisting of positive integers.
Return the total frequencies of elements in numssuch that those elements all have the maximum frequency.
The frequency of an element is the number of occurrences of that element in the array.

Example 1:

Input: nums = [1,2,2,3,1,4]
Output: 4
Explanation: The elements 1 and 2 have a frequency of 2 which is the maximum frequency in the array.
So the number of elements in the array with maximum frequency is 4.

Example 2:

Input: nums = [1,2,3,4,5]
Output: 5
Explanation: All elements of the array have a frequency of 1 which is the maximum.
So the number of elements in the array with maximum frequency is 5.

Constraints:

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

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

```

my_solution = Solution()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

Find Beautiful Indices in the Given Array I

Prompt:
"""
You are given a 0-indexed string s, a string a, a string b, and an integer k.
An index i is beautiful if:

0 <= i <= s.length - a.length
s[i..(i + a.length - 1)] == a
There exists an index j such that:

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

Return the array that contains beautiful indices in sorted order from smallest to largest.

Example 1:

Input: s = "isawsquirrelnearmysquirrelhouseohmy", a = "my", b = "squirrel", k = 15
Output: [16,33]
Explanation: There are 2 beautiful indices: [16,33].
- The index 16 is beautiful as s[16..17] == "my" and there exists an index 4 with s[4..11] == "squirrel" and |16 - 4| <= 15.
- The index 33 is beautiful as s[33..34] == "my" and there exists an index 18 with s[18..25] == "squirrel" and |33 - 18| <= 15.
Thus we return [16,33] as the result.

Example 2:

Input: s = "abcd", a = "a", b = "a", k = 4
Output: [0]
Explanation: There is 1 beautiful index: [0].
- The index 0 is beautiful as s[0..0] == "a" and there exists an index 0 with s[0..0] == "a" and |0 - 0| <= 4.
Thus we return [0] as the result.

Constraints:

1 <= k <= s.length <= 105
1 <= a.length, b.length <= 10
s, a, and b contain only lowercase English letters.
"""
class Solution:
    def beautifulIndices(self, s: str, a: str, b: str, k: int) -> List[int]:

You are given a 0-indexed string s, a string a, a string b, and an integer k.
An index i is beautiful if:

0 <= i <= s.length - a.length
s[i..(i + a.length - 1)] == a
There exists an index j such that:

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

Return the array that contains beautiful indices in sorted order from smallest to largest.

Example 1:

Input: s = "isawsquirrelnearmysquirrelhouseohmy", a = "my", b = "squirrel", k = 15
Output: [16,33]
Explanation: There are 2 beautiful indices: [16,33].
- The index 16 is beautiful as s[16..17] == "my" and there exists an index 4 with s[4..11] == "squirrel" and |16 - 4| <= 15.
- The index 33 is beautiful as s[33..34] == "my" and there exists an index 18 with s[18..25] == "squirrel" and |33 - 18| <= 15.
Thus we return [16,33] as the result.

Example 2:

Input: s = "abcd", a = "a", b = "a", k = 4
Output: [0]
Explanation: There is 1 beautiful index: [0].
- The index 0 is beautiful as s[0..0] == "a" and there exists an index 0 with s[0..0] == "a" and |0 - 0| <= 4.
Thus we return [0] as the result.

Constraints:

1 <= k <= s.length <= 105
1 <= a.length, b.length <= 10
s, a, and b contain only lowercase English letters.

Please complete the code below to solve above prblem:
```python
class Solution:
    def beautifulIndices(self, s: str, a: str, b: str, k: int) -> List[int]:

```

my_solution = Solution()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

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

Prompt:
"""
You are given an integer k and an integer x.
Consider s is the 1-indexed binary representation of an integer num. The price of a number num is the number of i's such that i % x == 0 and s[i] is a set bit.
Return the greatest integer num such that the sum of prices of all numbers from 1 to num is less than or equal to k.
Note:

In the binary representation of a number set bit is a bit of value 1.
The binary representation of a number will be indexed from right to left. For example, if s == 11100, s[4] == 1 and s[2] == 0.

Example 1:

Input: k = 9, x = 1
Output: 6
Explanation: The numbers 1, 2, 3, 4, 5, and 6 can be written in binary representation as "1", "10", "11", "100", "101", and "110" respectively.
Since x is equal to 1, the price of each number is the number of its set bits.
The number of set bits in these numbers is 9. So the sum of the prices of the first 6 numbers is 9.
So the answer is 6.
Example 2:

Input: k = 7, x = 2
Output: 9
Explanation: Since x is equal to 2, we should just check eventh bits.
The second bit of binary representation of numbers 2 and 3 is a set bit. So the sum of their prices is 2.
The second bit of binary representation of numbers 6 and 7 is a set bit. So the sum of their prices is 2.
The fourth bit of binary representation of numbers 8 and 9 is a set bit but their second bit is not. So the sum of their prices is 2.
Numbers 1, 4, and 5 don't have set bits in their eventh bits in their binary representation. So the sum of their prices is 0.
The second and the fourth bit of the binary representation of the number 10 are a set bit. So its price is 2.
The sum of the prices of the first 9 numbers is 6.
Because the sum of the prices of the first 10 numbers is 8, the answer is 9.

Constraints:

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

You are given an integer k and an integer x.
Consider s is the 1-indexed binary representation of an integer num. The price of a number num is the number of i's such that i % x == 0 and s[i] is a set bit.
Return the greatest integer num such that the sum of prices of all numbers from 1 to num is less than or equal to k.
Note:

In the binary representation of a number set bit is a bit of value 1.
The binary representation of a number will be indexed from right to left. For example, if s == 11100, s[4] == 1 and s[2] == 0.

Example 1:

Input: k = 9, x = 1
Output: 6
Explanation: The numbers 1, 2, 3, 4, 5, and 6 can be written in binary representation as "1", "10", "11", "100", "101", and "110" respectively.
Since x is equal to 1, the price of each number is the number of its set bits.
The number of set bits in these numbers is 9. So the sum of the prices of the first 6 numbers is 9.
So the answer is 6.
Example 2:

Input: k = 7, x = 2
Output: 9
Explanation: Since x is equal to 2, we should just check eventh bits.
The second bit of binary representation of numbers 2 and 3 is a set bit. So the sum of their prices is 2.
The second bit of binary representation of numbers 6 and 7 is a set bit. So the sum of their prices is 2.
The fourth bit of binary representation of numbers 8 and 9 is a set bit but their second bit is not. So the sum of their prices is 2.
Numbers 1, 4, and 5 don't have set bits in their eventh bits in their binary representation. So the sum of their prices is 0.
The second and the fourth bit of the binary representation of the number 10 are a set bit. So its price is 2.
The sum of the prices of the first 9 numbers is 6.
Because the sum of the prices of the first 10 numbers is 8, the answer is 9.

Constraints:

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

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

```

my_solution = Solution()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

Find Beautiful Indices in the Given Array II

Prompt:
"""
You are given a 0-indexed string s, a string a, a string b, and an integer k.
An index i is beautiful if:

0 <= i <= s.length - a.length
s[i..(i + a.length - 1)] == a
There exists an index j such that:

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

Return the array that contains beautiful indices in sorted order from smallest to largest.

Example 1:

Input: s = "isawsquirrelnearmysquirrelhouseohmy", a = "my", b = "squirrel", k = 15
Output: [16,33]
Explanation: There are 2 beautiful indices: [16,33].
- The index 16 is beautiful as s[16..17] == "my" and there exists an index 4 with s[4..11] == "squirrel" and |16 - 4| <= 15.
- The index 33 is beautiful as s[33..34] == "my" and there exists an index 18 with s[18..25] == "squirrel" and |33 - 18| <= 15.
Thus we return [16,33] as the result.

Example 2:

Input: s = "abcd", a = "a", b = "a", k = 4
Output: [0]
Explanation: There is 1 beautiful index: [0].
- The index 0 is beautiful as s[0..0] == "a" and there exists an index 0 with s[0..0] == "a" and |0 - 0| <= 4.
Thus we return [0] as the result.

Constraints:

1 <= k <= s.length <= 5 * 105
1 <= a.length, b.length <= 5 * 105
s, a, and b contain only lowercase English letters.
"""
class Solution:
    def beautifulIndices(self, s: str, a: str, b: str, k: int) -> List[int]:

You are given a 0-indexed string s, a string a, a string b, and an integer k.
An index i is beautiful if:

0 <= i <= s.length - a.length
s[i..(i + a.length - 1)] == a
There exists an index j such that:

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

Return the array that contains beautiful indices in sorted order from smallest to largest.

Example 1:

Input: s = "isawsquirrelnearmysquirrelhouseohmy", a = "my", b = "squirrel", k = 15
Output: [16,33]
Explanation: There are 2 beautiful indices: [16,33].
- The index 16 is beautiful as s[16..17] == "my" and there exists an index 4 with s[4..11] == "squirrel" and |16 - 4| <= 15.
- The index 33 is beautiful as s[33..34] == "my" and there exists an index 18 with s[18..25] == "squirrel" and |33 - 18| <= 15.
Thus we return [16,33] as the result.

Example 2:

Input: s = "abcd", a = "a", b = "a", k = 4
Output: [0]
Explanation: There is 1 beautiful index: [0].
- The index 0 is beautiful as s[0..0] == "a" and there exists an index 0 with s[0..0] == "a" and |0 - 0| <= 4.
Thus we return [0] as the result.

Constraints:

1 <= k <= s.length <= 5 * 105
1 <= a.length, b.length <= 5 * 105
s, a, and b contain only lowercase English letters.

Please complete the code below to solve above prblem:
```python
class Solution:
    def beautifulIndices(self, s: str, a: str, b: str, k: int) -> List[int]:

```

my_solution = Solution()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


maximum-area-of-longest-diagonal-rectangle

Maximum Area of Longest Diagonal Rectangle

Prompt:
"""
You are given a 2D 0-indexed integer array dimensions.
For all indices i, 0 <= i < dimensions.length, dimensions[i][0] represents the length and dimensions[i][1] represents the width of the rectangle i.
Return the area of the rectangle having the longest diagonal. If there are multiple rectangles with the longest diagonal, return the area of the rectangle having the maximum area.

Example 1:

Input: dimensions = [[9,3],[8,6]]
Output: 48
Explanation:
For index = 0, length = 9 and width = 3. Diagonal length = sqrt(9 * 9 + 3 * 3) = sqrt(90) ≈ 9.487.
For index = 1, length = 8 and width = 6. Diagonal length = sqrt(8 * 8 + 6 * 6) = sqrt(100) = 10.
So, the rectangle at index 1 has a greater diagonal length therefore we return area = 8 * 6 = 48.

Example 2:

Input: dimensions = [[3,4],[4,3]]
Output: 12
Explanation: Length of diagonal is the same for both which is 5, so maximum area = 12.

Constraints:

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

You are given a 2D 0-indexed integer array dimensions.
For all indices i, 0 <= i < dimensions.length, dimensions[i][0] represents the length and dimensions[i][1] represents the width of the rectangle i.
Return the area of the rectangle having the longest diagonal. If there are multiple rectangles with the longest diagonal, return the area of the rectangle having the maximum area.

Example 1:

Input: dimensions = [[9,3],[8,6]]
Output: 48
Explanation:
For index = 0, length = 9 and width = 3. Diagonal length = sqrt(9 * 9 + 3 * 3) = sqrt(90) ≈ 9.487.
For index = 1, length = 8 and width = 6. Diagonal length = sqrt(8 * 8 + 6 * 6) = sqrt(100) = 10.
So, the rectangle at index 1 has a greater diagonal length therefore we return area = 8 * 6 = 48.

Example 2:

Input: dimensions = [[3,4],[4,3]]
Output: 12
Explanation: Length of diagonal is the same for both which is 5, so maximum area = 12.

Constraints:

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

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

```

my_solution = Solution()

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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