count-stepping-numbers-in-range

Count Stepping Numbers in Range

Prompt:
"""
给你两个正整数 low 和 high ，都用字符串表示，请你统计闭区间 [low, high] 内的 步进数字 数目。

如果一个整数相邻数位之间差的绝对值都 恰好 是 1 ，那么这个数字被称为 步进数字 。

请你返回一个整数，表示闭区间 [low, high] 之间步进数字的数目。

由于答案可能很大，请你将它对 109 + 7 取余 后返回。

注意：步进数字不能有前导 0 。

示例 1：

输入：low = "1", high = "11"
输出：10
解释：区间 [1,11] 内的步进数字为 1 ，2 ，3 ，4 ，5 ，6 ，7 ，8 ，9 和 10 。总共有 10 个步进数字。所以输出为 10 。

示例 2：

输入：low = "90", high = "101"
输出：2
解释：区间 [90,101] 内的步进数字为 98 和 101 。总共有 2 个步进数字。所以输出为 2 。

提示：

 * 1 <= int(low) <= int(high) < 10100
 * 1 <= low.length, high.length <= 100
 * low 和 high 只包含数字。
 * low 和 high 都不含前导 0 。
"""
class Solution:
    def countSteppingNumbers(self, low: str, high: str) -> int:

给你两个正整数 low 和 high ，都用字符串表示，请你统计闭区间 [low, high] 内的 步进数字 数目。

如果一个整数相邻数位之间差的绝对值都 恰好 是 1 ，那么这个数字被称为 步进数字 。

请你返回一个整数，表示闭区间 [low, high] 之间步进数字的数目。

由于答案可能很大，请你将它对 109 + 7 取余 后返回。

注意：步进数字不能有前导 0 。

示例 1：

输入：low = "1", high = "11"
输出：10
解释：区间 [1,11] 内的步进数字为 1 ，2 ，3 ，4 ，5 ，6 ，7 ，8 ，9 和 10 。总共有 10 个步进数字。所以输出为 10 。

示例 2：

输入：low = "90", high = "101"
输出：2
解释：区间 [90,101] 内的步进数字为 98 和 101 。总共有 2 个步进数字。所以输出为 2 。

提示：

 * 1 <= int(low) <= int(high) < 10100
 * 1 <= low.length, high.length <= 100
 * low 和 high 只包含数字。
 * low 和 high 都不含前导 0 。

请完成下面的代码来解决上述问题:
```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


split-strings-by-separator

Split Strings by Separator

Prompt:
"""
给你一个字符串数组 words 和一个字符 separator ，请你按 separator 拆分 words 中的每个字符串。

返回一个由拆分后的新字符串组成的字符串数组，不包括空字符串 。

注意

 * separator 用于决定拆分发生的位置，但它不包含在结果字符串中。
 * 拆分可能形成两个以上的字符串。
 * 结果字符串必须保持初始相同的先后顺序。

示例 1：

输入：words = ["one.two.three","four.five","six"], separator = "."
输出：["one","two","three","four","five","six"]
解释：在本示例中，我们进行下述拆分：

"one.two.three" 拆分为 "one", "two", "three"
"four.five" 拆分为 "four", "five"
"six" 拆分为 "six"

因此，结果数组为 ["one","two","three","four","five","six"] 。

示例 2：

输入：words = ["$easy$","$problem$"], separator = "$"
输出：["easy","problem"]
解释：在本示例中，我们进行下述拆分：

"$easy$" 拆分为 "easy"（不包括空字符串）
"$problem$" 拆分为 "problem"（不包括空字符串）

因此，结果数组为 ["easy","problem"] 。

示例 3：

输入：words = ["|||"], separator = "|"
输出：[]
解释：在本示例中，"|||" 的拆分结果将只包含一些空字符串，所以我们返回一个空数组 [] 。

提示：

 * 1 <= words.length <= 100
 * 1 <= words[i].length <= 20
 * words[i] 中的字符要么是小写英文字母，要么就是字符串 ".,|$#@" 中的字符（不包括引号）
 * separator 是字符串 ".,|$#@" 中的某个字符（不包括引号）
"""
class Solution:
    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:

给你一个字符串数组 words 和一个字符 separator ，请你按 separator 拆分 words 中的每个字符串。

返回一个由拆分后的新字符串组成的字符串数组，不包括空字符串 。

注意

 * separator 用于决定拆分发生的位置，但它不包含在结果字符串中。
 * 拆分可能形成两个以上的字符串。
 * 结果字符串必须保持初始相同的先后顺序。

示例 1：

输入：words = ["one.two.three","four.five","six"], separator = "."
输出：["one","two","three","four","five","six"]
解释：在本示例中，我们进行下述拆分：

"one.two.three" 拆分为 "one", "two", "three"
"four.five" 拆分为 "four", "five"
"six" 拆分为 "six"

因此，结果数组为 ["one","two","three","four","five","six"] 。

示例 2：

输入：words = ["$easy$","$problem$"], separator = "$"
输出：["easy","problem"]
解释：在本示例中，我们进行下述拆分：

"$easy$" 拆分为 "easy"（不包括空字符串）
"$problem$" 拆分为 "problem"（不包括空字符串）

因此，结果数组为 ["easy","problem"] 。

示例 3：

输入：words = ["|||"], separator = "|"
输出：[]
解释：在本示例中，"|||" 的拆分结果将只包含一些空字符串，所以我们返回一个空数组 [] 。

提示：

 * 1 <= words.length <= 100
 * 1 <= words[i].length <= 20
 * words[i] 中的字符要么是小写英文字母，要么就是字符串 ".,|$#@" 中的字符（不包括引号）
 * separator 是字符串 ".,|$#@" 中的某个字符（不包括引号）

请完成下面的代码来解决上述问题:
```python
class Solution:
    def splitWordsBySeparator(self, words: List[str], separator: str) -> List[str]:

```

my_solution = Solution()

test_input = { "words": ["one.two.three","four.five","six"], "separator": "." }
assert my_solution.splitWordsBySeparator(**test_input) == ["one","two","three","four","five","six"]

test_input = { "words": ["$easy$","$problem$"], "separator": "$" }
assert my_solution.splitWordsBySeparator(**test_input) == ["easy","problem"]

test_input = { "words": ["|||"], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == []

test_input = { "words": ["stars.bars.$"], "separator": "." }
assert my_solution.splitWordsBySeparator(**test_input) == ["stars","bars","$"]

test_input = { "words": ["###x#i@f"], "separator": "#" }
assert my_solution.splitWordsBySeparator(**test_input) == ["x","i@f"]

test_input = { "words": ["##q@t#"], "separator": "#" }
assert my_solution.splitWordsBySeparator(**test_input) == ["q@t"]

test_input = { "words": ["#,"], "separator": "#" }
assert my_solution.splitWordsBySeparator(**test_input) == [","]

test_input = { "words": ["#@"], "separator": "@" }
assert my_solution.splitWordsBySeparator(**test_input) == ["#"]

test_input = { "words": ["#a$f$nwgq#vw"], "separator": "$" }
assert my_solution.splitWordsBySeparator(**test_input) == ["#a","f","nwgq#vw"]

test_input = { "words": ["#uyddd,trxiwfv"], "separator": "," }
assert my_solution.splitWordsBySeparator(**test_input) == ["#uyddd","trxiwfv"]

test_input = { "words": ["#x"], "separator": "$" }
assert my_solution.splitWordsBySeparator(**test_input) == ["#x"]

test_input = { "words": ["#x#,"], "separator": "," }
assert my_solution.splitWordsBySeparator(**test_input) == ["#x#"]

test_input = { "words": ["#|"], "separator": "#" }
assert my_solution.splitWordsBySeparator(**test_input) == ["|"]

test_input = { "words": ["#|a|b|##|#|#g#u|"], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == ["#","a","b","##","#","#g#u"]

test_input = { "words": ["$$.o.$$."], "separator": "$" }
assert my_solution.splitWordsBySeparator(**test_input) == [".o.","."]

test_input = { "words": ["$,,"], "separator": "," }
assert my_solution.splitWordsBySeparator(**test_input) == ["$"]

test_input = { "words": ["$j@@@"], "separator": "@" }
assert my_solution.splitWordsBySeparator(**test_input) == ["$j"]

test_input = { "words": [",$$"], "separator": "$" }
assert my_solution.splitWordsBySeparator(**test_input) == [","]

test_input = { "words": [",,"], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == [",,"]

test_input = { "words": [",,,@@n"], "separator": "," }
assert my_solution.splitWordsBySeparator(**test_input) == ["@@n"]

test_input = { "words": [",,,@o,"], "separator": "," }
assert my_solution.splitWordsBySeparator(**test_input) == ["@o"]

test_input = { "words": [",,,p,#r#"], "separator": "," }
assert my_solution.splitWordsBySeparator(**test_input) == ["p","#r#"]

test_input = { "words": [",,."], "separator": "," }
assert my_solution.splitWordsBySeparator(**test_input) == ["."]

test_input = { "words": [",,ulxh|,u|ustg||ulo"], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == [",,ulxh",",u","ustg","ulo"]

test_input = { "words": [",esplco"], "separator": "." }
assert my_solution.splitWordsBySeparator(**test_input) == [",esplco"]

test_input = { "words": [",g#,,,#"], "separator": "," }
assert my_solution.splitWordsBySeparator(**test_input) == ["g#","#"]

test_input = { "words": [",gko"], "separator": "." }
assert my_solution.splitWordsBySeparator(**test_input) == [",gko"]

test_input = { "words": [",h,u.f"], "separator": "," }
assert my_solution.splitWordsBySeparator(**test_input) == ["h","u.f"]

test_input = { "words": [",y|z|bg,"], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == [",y","z","bg,"]

test_input = { "words": [".#z.###b"], "separator": "#" }
assert my_solution.splitWordsBySeparator(**test_input) == [".","z.","b"]

test_input = { "words": [".."], "separator": "." }
assert my_solution.splitWordsBySeparator(**test_input) == []

test_input = { "words": [".@"], "separator": "." }
assert my_solution.splitWordsBySeparator(**test_input) == ["@"]

test_input = { "words": [".n#.#.."], "separator": "#" }
assert my_solution.splitWordsBySeparator(**test_input) == [".n",".",".."]

test_input = { "words": [".trs.t..cvvw.,..p"], "separator": "." }
assert my_solution.splitWordsBySeparator(**test_input) == ["trs","t","cvvw",",","p"]

test_input = { "words": [".vy.$$.qw"], "separator": "." }
assert my_solution.splitWordsBySeparator(**test_input) == ["vy","$$","qw"]

test_input = { "words": ["@,,"], "separator": "@" }
assert my_solution.splitWordsBySeparator(**test_input) == [",,"]

test_input = { "words": ["@..@@.s.@u@.@"], "separator": "." }
assert my_solution.splitWordsBySeparator(**test_input) == ["@","@@","s","@u@","@"]

test_input = { "words": ["@@..@@@.@vn@"], "separator": "." }
assert my_solution.splitWordsBySeparator(**test_input) == ["@@","@@@","@vn@"]

test_input = { "words": ["@@@@@@@...@@@"], "separator": "." }
assert my_solution.splitWordsBySeparator(**test_input) == ["@@@@@@@","@@@"]

test_input = { "words": ["@@@@@@g@@v"], "separator": "@" }
assert my_solution.splitWordsBySeparator(**test_input) == ["g","v"]

test_input = { "words": ["@@||@"], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == ["@@","@"]

test_input = { "words": ["@acp.@"], "separator": "." }
assert my_solution.splitWordsBySeparator(**test_input) == ["@acp","@"]

test_input = { "words": ["@iw"], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == ["@iw"]

test_input = { "words": ["@z#y@@ni"], "separator": "#" }
assert my_solution.splitWordsBySeparator(**test_input) == ["@z","y@@ni"]

test_input = { "words": ["aovx"], "separator": "$" }
assert my_solution.splitWordsBySeparator(**test_input) == ["aovx"]

test_input = { "words": ["b"], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == ["b"]

test_input = { "words": ["b,,"], "separator": "." }
assert my_solution.splitWordsBySeparator(**test_input) == ["b,,"]

test_input = { "words": ["b,s"], "separator": "," }
assert my_solution.splitWordsBySeparator(**test_input) == ["b","s"]

test_input = { "words": ["bqukl,bv"], "separator": "," }
assert my_solution.splitWordsBySeparator(**test_input) == ["bqukl","bv"]

test_input = { "words": ["cmypa#"], "separator": "#" }
assert my_solution.splitWordsBySeparator(**test_input) == ["cmypa"]

test_input = { "words": ["cq,,,,y"], "separator": "$" }
assert my_solution.splitWordsBySeparator(**test_input) == ["cq,,,,y"]

test_input = { "words": ["d,,,@d"], "separator": "," }
assert my_solution.splitWordsBySeparator(**test_input) == ["d","@d"]

test_input = { "words": ["dgjtc"], "separator": "." }
assert my_solution.splitWordsBySeparator(**test_input) == ["dgjtc"]

test_input = { "words": ["e$,$,w$,,z,,$$,"], "separator": "," }
assert my_solution.splitWordsBySeparator(**test_input) == ["e$","$","w$","z","$$"]

test_input = { "words": ["e,,$,$,,,"], "separator": "," }
assert my_solution.splitWordsBySeparator(**test_input) == ["e","$","$"]

test_input = { "words": ["edz."], "separator": "$" }
assert my_solution.splitWordsBySeparator(**test_input) == ["edz."]

test_input = { "words": ["f"], "separator": "." }
assert my_solution.splitWordsBySeparator(**test_input) == ["f"]

test_input = { "words": ["f."], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == ["f."]

test_input = { "words": ["g"], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == ["g"]

test_input = { "words": ["g###"], "separator": "@" }
assert my_solution.splitWordsBySeparator(**test_input) == ["g###"]

test_input = { "words": ["g|@@@@@|"], "separator": "@" }
assert my_solution.splitWordsBySeparator(**test_input) == ["g|","|"]

test_input = { "words": ["h"], "separator": "." }
assert my_solution.splitWordsBySeparator(**test_input) == ["h"]

test_input = { "words": ["h#"], "separator": "#" }
assert my_solution.splitWordsBySeparator(**test_input) == ["h"]

test_input = { "words": ["hpo"], "separator": "," }
assert my_solution.splitWordsBySeparator(**test_input) == ["hpo"]

test_input = { "words": ["imq#zect"], "separator": "," }
assert my_solution.splitWordsBySeparator(**test_input) == ["imq#zect"]

test_input = { "words": ["io@"], "separator": "." }
assert my_solution.splitWordsBySeparator(**test_input) == ["io@"]

test_input = { "words": ["j@..@f.v@."], "separator": "@" }
assert my_solution.splitWordsBySeparator(**test_input) == ["j","..","f.v","."]

test_input = { "words": ["jxe|xfim"], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == ["jxe","xfim"]

test_input = { "words": ["lyegjxsg"], "separator": "," }
assert my_solution.splitWordsBySeparator(**test_input) == ["lyegjxsg"]

test_input = { "words": ["l|"], "separator": "$" }
assert my_solution.splitWordsBySeparator(**test_input) == ["l|"]

test_input = { "words": ["mm..,.j.."], "separator": "." }
assert my_solution.splitWordsBySeparator(**test_input) == ["mm",",","j"]

test_input = { "words": ["n."], "separator": "." }
assert my_solution.splitWordsBySeparator(**test_input) == ["n"]

test_input = { "words": ["no#"], "separator": "," }
assert my_solution.splitWordsBySeparator(**test_input) == ["no#"]

test_input = { "words": ["nyy|"], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == ["nyy"]

test_input = { "words": ["pfx|ons"], "separator": "@" }
assert my_solution.splitWordsBySeparator(**test_input) == ["pfx|ons"]

test_input = { "words": ["pl"], "separator": "#" }
assert my_solution.splitWordsBySeparator(**test_input) == ["pl"]

test_input = { "words": ["q"], "separator": "@" }
assert my_solution.splitWordsBySeparator(**test_input) == ["q"]

test_input = { "words": ["q"], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == ["q"]

test_input = { "words": ["qv"], "separator": "$" }
assert my_solution.splitWordsBySeparator(**test_input) == ["qv"]

test_input = { "words": ["r"], "separator": "@" }
assert my_solution.splitWordsBySeparator(**test_input) == ["r"]

test_input = { "words": ["rxs|$mg"], "separator": "$" }
assert my_solution.splitWordsBySeparator(**test_input) == ["rxs|","mg"]

test_input = { "words": ["sls,l,xn"], "separator": "," }
assert my_solution.splitWordsBySeparator(**test_input) == ["sls","l","xn"]

test_input = { "words": ["t@"], "separator": "@" }
assert my_solution.splitWordsBySeparator(**test_input) == ["t"]

test_input = { "words": ["tsklm|dhmsr"], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == ["tsklm","dhmsr"]

test_input = { "words": ["t|@@w||"], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == ["t","@@w"]

test_input = { "words": ["u"], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == ["u"]

test_input = { "words": ["ufjvddie"], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == ["ufjvddie"]

test_input = { "words": ["unvywqeuqvdq"], "separator": "$" }
assert my_solution.splitWordsBySeparator(**test_input) == ["unvywqeuqvdq"]

test_input = { "words": ["vt@"], "separator": "@" }
assert my_solution.splitWordsBySeparator(**test_input) == ["vt"]

test_input = { "words": ["w,xu#v,m,jh,"], "separator": "," }
assert my_solution.splitWordsBySeparator(**test_input) == ["w","xu#v","m","jh"]

test_input = { "words": ["w|vip|"], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == ["w","vip"]

test_input = { "words": ["xjmjh$@"], "separator": "@" }
assert my_solution.splitWordsBySeparator(**test_input) == ["xjmjh$"]

test_input = { "words": ["xm,tjd$"], "separator": "$" }
assert my_solution.splitWordsBySeparator(**test_input) == ["xm,tjd"]

test_input = { "words": ["yww"], "separator": "@" }
assert my_solution.splitWordsBySeparator(**test_input) == ["yww"]

test_input = { "words": ["z"], "separator": "$" }
assert my_solution.splitWordsBySeparator(**test_input) == ["z"]

test_input = { "words": ["z#|||###"], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == ["z#","###"]

test_input = { "words": ["zb@"], "separator": "," }
assert my_solution.splitWordsBySeparator(**test_input) == ["zb@"]

test_input = { "words": ["|,,|,|||"], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == [",,",","]

test_input = { "words": ["|,r,fg"], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == [",r,fg"]

test_input = { "words": ["|."], "separator": "|" }
assert my_solution.splitWordsBySeparator(**test_input) == ["."]


largest-element-in-an-array-after-merge-operations

Largest Element in an Array after Merge Operations

Prompt:
"""
给你一个下标从 0 开始、由正整数组成的数组 nums 。

你可以在数组上执行下述操作 任意 次：

 * 选中一个同时满足 0 <= i < nums.length - 1 和 nums[i] <= nums[i + 1] 的整数 i 。将元素 nums[i + 1] 替换为 nums[i] + nums[i + 1] ，并从数组中删除元素 nums[i] 。

返回你可以从最终数组中获得的 最大 元素的值。

示例 1：

输入：nums = [2,3,7,9,3]
输出：21
解释：我们可以在数组上执行下述操作：
- 选中 i = 0 ，得到数组 nums = [5,7,9,3] 。
- 选中 i = 1 ，得到数组 nums = [5,16,3] 。
- 选中 i = 0 ，得到数组 nums = [21,3] 。
最终数组中的最大元素是 21 。可以证明我们无法获得更大的元素。

示例 2：

输入：nums = [5,3,3]
输出：11
解释：我们可以在数组上执行下述操作：
- 选中 i = 1 ，得到数组 nums = [5,6] 。
- 选中 i = 0 ，得到数组 nums = [11] 。
最终数组中只有一个元素，即 11 。

提示：

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

给你一个下标从 0 开始、由正整数组成的数组 nums 。

你可以在数组上执行下述操作 任意 次：

 * 选中一个同时满足 0 <= i < nums.length - 1 和 nums[i] <= nums[i + 1] 的整数 i 。将元素 nums[i + 1] 替换为 nums[i] + nums[i + 1] ，并从数组中删除元素 nums[i] 。

返回你可以从最终数组中获得的 最大 元素的值。

示例 1：

输入：nums = [2,3,7,9,3]
输出：21
解释：我们可以在数组上执行下述操作：
- 选中 i = 0 ，得到数组 nums = [5,7,9,3] 。
- 选中 i = 1 ，得到数组 nums = [5,16,3] 。
- 选中 i = 0 ，得到数组 nums = [21,3] 。
最终数组中的最大元素是 21 。可以证明我们无法获得更大的元素。

示例 2：

输入：nums = [5,3,3]
输出：11
解释：我们可以在数组上执行下述操作：
- 选中 i = 1 ，得到数组 nums = [5,6] 。
- 选中 i = 0 ，得到数组 nums = [11] 。
最终数组中只有一个元素，即 11 。

提示：

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

请完成下面的代码来解决上述问题:
```python
class Solution:
    def maxArrayValue(self, nums: List[int]) -> int:

```


maximum-number-of-groups-with-increasing-length

Maximum Number of Groups With Increasing Length

Prompt:
"""
给你一个下标从 0 开始、长度为 n 的数组 usageLimits 。

你的任务是使用从 0 到 n - 1 的数字创建若干组，并确保每个数字 i 在 所有组 中使用的次数总共不超过 usageLimits[i] 次。此外，还必须满足以下条件：

 * 每个组必须由 不同 的数字组成，也就是说，单个组内不能存在重复的数字。
 * 每个组（除了第一个）的长度必须 严格大于 前一个组。

在满足所有条件的情况下，以整数形式返回可以创建的最大组数。

示例 1：

输入：usageLimits = [1,2,5]
输出：3
解释：在这个示例中，我们可以使用 0 至多一次，使用 1 至多 2 次，使用 2 至多 5 次。
一种既能满足所有条件，又能创建最多组的方式是：
组 1 包含数字 [2] 。
组 2 包含数字 [1,2] 。
组 3 包含数字 [0,1,2] 。
可以证明能够创建的最大组数是 3 。
所以，输出是 3 。

示例 2：

输入：usageLimits = [2,1,2]
输出：2
解释：在这个示例中，我们可以使用 0 至多 2 次，使用 1 至多 1 次，使用 2 至多 2 次。
一种既能满足所有条件，又能创建最多组的方式是：
组 1 包含数字 [0] 。
组 2 包含数字 [1,2] 。
可以证明能够创建的最大组数是 2 。
所以，输出是 2 。

示例 3：

输入：usageLimits = [1,1]
输出：1
解释：在这个示例中，我们可以使用 0 和 1 至多 1 次。
一种既能满足所有条件，又能创建最多组的方式是：
组 1 包含数字 [0] 。
可以证明能够创建的最大组数是 1 。
所以，输出是 1 。

提示：

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

给你一个下标从 0 开始、长度为 n 的数组 usageLimits 。

你的任务是使用从 0 到 n - 1 的数字创建若干组，并确保每个数字 i 在 所有组 中使用的次数总共不超过 usageLimits[i] 次。此外，还必须满足以下条件：

 * 每个组必须由 不同 的数字组成，也就是说，单个组内不能存在重复的数字。
 * 每个组（除了第一个）的长度必须 严格大于 前一个组。

在满足所有条件的情况下，以整数形式返回可以创建的最大组数。

示例 1：

输入：usageLimits = [1,2,5]
输出：3
解释：在这个示例中，我们可以使用 0 至多一次，使用 1 至多 2 次，使用 2 至多 5 次。
一种既能满足所有条件，又能创建最多组的方式是：
组 1 包含数字 [2] 。
组 2 包含数字 [1,2] 。
组 3 包含数字 [0,1,2] 。
可以证明能够创建的最大组数是 3 。
所以，输出是 3 。

示例 2：

输入：usageLimits = [2,1,2]
输出：2
解释：在这个示例中，我们可以使用 0 至多 2 次，使用 1 至多 1 次，使用 2 至多 2 次。
一种既能满足所有条件，又能创建最多组的方式是：
组 1 包含数字 [0] 。
组 2 包含数字 [1,2] 。
可以证明能够创建的最大组数是 2 。
所以，输出是 2 。

示例 3：

输入：usageLimits = [1,1]
输出：1
解释：在这个示例中，我们可以使用 0 和 1 至多 1 次。
一种既能满足所有条件，又能创建最多组的方式是：
组 1 包含数字 [0] 。
可以证明能够创建的最大组数是 1 。
所以，输出是 1 。

提示：

 * 1 <= usageLimits.length <= 105
 * 1 <= usageLimits[i] <= 109

请完成下面的代码来解决上述问题:
```python
class Solution:
    def maxIncreasingGroups(self, usageLimits: List[int]) -> int:

```

my_solution = Solution()

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

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

test_input = { "usageLimits": [1,1] }
assert my_solution.maxIncreasingGroups(**test_input) == 1

test_input = { "usageLimits": [1,4] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

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

test_input = { "usageLimits": [1,7] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [1,8] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

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

test_input = { "usageLimits": [2,2] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [2,3] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [2,4] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [2,5] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [2,7] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [2,8] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [2,9] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

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

test_input = { "usageLimits": [3,4] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [3,7] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [3,10] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [4,1] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [4,2] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [4,4] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

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

test_input = { "usageLimits": [4,7] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

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

test_input = { "usageLimits": [5,8] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [5,10] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [6,2] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [6,3] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [6,4] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [6,5] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [6,6] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [6,7] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [6,9] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [6,19] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [7,1] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [7,2] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [7,3] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [7,4] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [7,7] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

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

test_input = { "usageLimits": [8,3] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [8,6] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [9,1] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [9,3] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [9,4] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [9,6] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [9,8] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [9,10] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [10,2] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [10,3] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

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

test_input = { "usageLimits": [10,11] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [13,11] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

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

test_input = { "usageLimits": [16,9] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [18,6] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

test_input = { "usageLimits": [32,42] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

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

test_input = { "usageLimits": [1,1,10] }
assert my_solution.maxIncreasingGroups(**test_input) == 2

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

test_input = { "usageLimits": [1,4,5] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [1,6,4] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [1,6,8] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [1,7,19] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [1,8,6] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [1,9,5] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

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

test_input = { "usageLimits": [1,10,6] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [2,2,2] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [2,3,8] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [2,6,10] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [2,7,2] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [2,7,7] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [2,8,7] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [2,9,9] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

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

test_input = { "usageLimits": [3,5,5] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

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

test_input = { "usageLimits": [3,6,5] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [3,7,4] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [3,7,10] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

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

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

test_input = { "usageLimits": [3,10,9] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

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

test_input = { "usageLimits": [4,2,15] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [4,5,5] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [4,7,9] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [4,8,2] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [4,8,4] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [4,10,3] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [4,10,4] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [5,1,5] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [5,2,9] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [5,2,10] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [5,6,1] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [5,6,5] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [5,7,4] }
assert my_solution.maxIncreasingGroups(**test_input) == 3

test_input = { "usageLimits": [5,10,3] }
assert my_solution.maxIncreasingGroups(**test_input) == 3


count-paths-that-can-form-a-palindrome-in-a-tree

Count Paths That Can Form a Palindrome in a Tree

Prompt:
"""
给你一棵 树（即，一个连通、无向且无环的图），根 节点为 0 ，由编号从 0 到 n - 1 的 n 个节点组成。这棵树用一个长度为 n 、下标从 0 开始的数组 parent 表示，其中 parent[i] 为节点 i 的父节点，由于节点 0 为根节点，所以 parent[0] == -1 。

另给你一个长度为 n 的字符串 s ，其中 s[i] 是分配给 i 和 parent[i] 之间的边的字符。s[0] 可以忽略。

找出满足 u < v ，且从 u 到 v 的路径上分配的字符可以 重新排列 形成 回文 的所有节点对 (u, v) ，并返回节点对的数目。

如果一个字符串正着读和反着读都相同，那么这个字符串就是一个 回文 。

示例 1：

[https://assets.leetcode.com/uploads/2023/07/15/treedrawio-8drawio.png]

输入：parent = [-1,0,0,1,1,2], s = "acaabc"
输出：8
解释：符合题目要求的节点对分别是：
- (0,1)、(0,2)、(1,3)、(1,4) 和 (2,5) ，路径上只有一个字符，满足回文定义。
- (2,3)，路径上字符形成的字符串是 "aca" ，满足回文定义。
- (1,5)，路径上字符形成的字符串是 "cac" ，满足回文定义。
- (3,5)，路径上字符形成的字符串是 "acac" ，可以重排形成回文 "acca" 。

示例 2：

输入：parent = [-1,0,0,0,0], s = "aaaaa"
输出：10
解释：任何满足 u < v 的节点对 (u,v) 都符合题目要求。

提示：

 * n == parent.length == s.length
 * 1 <= n <= 105
 * 对于所有 i >= 1 ，0 <= parent[i] <= n - 1 均成立
 * parent[0] == -1
 * parent 表示一棵有效的树
 * s 仅由小写英文字母组成
"""
class Solution:
    def countPalindromePaths(self, parent: List[int], s: str) -> int:

给你一棵 树（即，一个连通、无向且无环的图），根 节点为 0 ，由编号从 0 到 n - 1 的 n 个节点组成。这棵树用一个长度为 n 、下标从 0 开始的数组 parent 表示，其中 parent[i] 为节点 i 的父节点，由于节点 0 为根节点，所以 parent[0] == -1 。

另给你一个长度为 n 的字符串 s ，其中 s[i] 是分配给 i 和 parent[i] 之间的边的字符。s[0] 可以忽略。

找出满足 u < v ，且从 u 到 v 的路径上分配的字符可以 重新排列 形成 回文 的所有节点对 (u, v) ，并返回节点对的数目。

如果一个字符串正着读和反着读都相同，那么这个字符串就是一个 回文 。

示例 1：

[https://assets.leetcode.com/uploads/2023/07/15/treedrawio-8drawio.png]

输入：parent = [-1,0,0,1,1,2], s = "acaabc"
输出：8
解释：符合题目要求的节点对分别是：
- (0,1)、(0,2)、(1,3)、(1,4) 和 (2,5) ，路径上只有一个字符，满足回文定义。
- (2,3)，路径上字符形成的字符串是 "aca" ，满足回文定义。
- (1,5)，路径上字符形成的字符串是 "cac" ，满足回文定义。
- (3,5)，路径上字符形成的字符串是 "acac" ，可以重排形成回文 "acca" 。

示例 2：

输入：parent = [-1,0,0,0,0], s = "aaaaa"
输出：10
解释：任何满足 u < v 的节点对 (u,v) 都符合题目要求。

提示：

 * n == parent.length == s.length
 * 1 <= n <= 105
 * 对于所有 i >= 1 ，0 <= parent[i] <= n - 1 均成立
 * parent[0] == -1
 * parent 表示一棵有效的树
 * s 仅由小写英文字母组成

请完成下面的代码来解决上述问题:
```python
class Solution:
    def countPalindromePaths(self, parent: List[int], s: str) -> int:

```

my_solution = Solution()

test_input = { "parent": [-1,0,0,1,1,2], "s": "acaabc" }
assert my_solution.countPalindromePaths(**test_input) == 8

test_input = { "parent": [-1,0,0,0,0], "s": "aaaaa" }
assert my_solution.countPalindromePaths(**test_input) == 10

test_input = { "parent": [-1,0], "s": "pi" }
assert my_solution.countPalindromePaths(**test_input) == 1

test_input = { "parent": [-1,5,0,5,5,2], "s": "xsbcqq" }
assert my_solution.countPalindromePaths(**test_input) == 7

test_input = { "parent": [-1,6,8,5,0,4,2,0,4], "s": "tiaiaivea" }
assert my_solution.countPalindromePaths(**test_input) == 20

test_input = { "parent": [-1,0,0,0,1,3,7,2], "s": "pxxgtgpp" }
assert my_solution.countPalindromePaths(**test_input) == 18

test_input = { "parent": [-1,0,1,4,1,0], "s": "hfhmmf" }
assert my_solution.countPalindromePaths(**test_input) == 12

test_input = { "parent": [-1,0,1], "s": "cri" }
assert my_solution.countPalindromePaths(**test_input) == 2

test_input = { "parent": [-1,0,0,5,7,0,0,1,2,0], "s": "snlzlzngna" }
assert my_solution.countPalindromePaths(**test_input) == 19

test_input = { "parent": [-1,0,0], "s": "sat" }
assert my_solution.countPalindromePaths(**test_input) == 2

test_input = { "parent": [-1,0], "s": "ko" }
assert my_solution.countPalindromePaths(**test_input) == 1

test_input = { "parent": [-1,0,6,4,1,6,3,1], "s": "jibwrfoi" }
assert my_solution.countPalindromePaths(**test_input) == 8

test_input = { "parent": [-1,4,0,4,6,0,5,5], "s": "bhrlorou" }
assert my_solution.countPalindromePaths(**test_input) == 18

test_input = { "parent": [-1,4,4,6,0,7,1,1], "s": "boqvndoo" }
assert my_solution.countPalindromePaths(**test_input) == 18

test_input = { "parent": [-1,2,0,1,0], "s": "eixnx" }
assert my_solution.countPalindromePaths(**test_input) == 6

test_input = { "parent": [-1,5,0,2,2,3], "s": "jwlllw" }
assert my_solution.countPalindromePaths(**test_input) == 14

test_input = { "parent": [-1,2,6,2,5,2,7,0], "s": "pipfippl" }
assert my_solution.countPalindromePaths(**test_input) == 15

test_input = { "parent": [-1,6,0,6,5,6,2,6,5,6], "s": "zwrdhnhwtf" }
assert my_solution.countPalindromePaths(**test_input) == 11

test_input = { "parent": [-1,4,1,1,5,0], "s": "gndfnj" }
assert my_solution.countPalindromePaths(**test_input) == 9

test_input = { "parent": [-1,0,0,0,1], "s": "crwkr" }
assert my_solution.countPalindromePaths(**test_input) == 7

test_input = { "parent": [-1,4,4,4,0,2,0], "s": "wwwwewd" }
assert my_solution.countPalindromePaths(**test_input) == 13

test_input = { "parent": [-1,2,0], "s": "mwz" }
assert my_solution.countPalindromePaths(**test_input) == 2

test_input = { "parent": [-1,0,1,6,5,0,1,1,1,0], "s": "mqgmjzrwuq" }
assert my_solution.countPalindromePaths(**test_input) == 14

test_input = { "parent": [-1,2,3,0,3,3,3,3], "s": "bnievjov" }
assert my_solution.countPalindromePaths(**test_input) == 8

test_input = { "parent": [-1,0,0], "s": "kyr" }
assert my_solution.countPalindromePaths(**test_input) == 2

test_input = { "parent": [-1,0,5,1,2,3,2,3,9,4], "s": "xukzwzsnww" }
assert my_solution.countPalindromePaths(**test_input) == 18

test_input = { "parent": [-1,6,0,1,5,0,2,2,6,0], "s": "snlpzocqpt" }
assert my_solution.countPalindromePaths(**test_input) == 10

test_input = { "parent": [-1,3,0,5,5,2], "s": "pxlxpl" }
assert my_solution.countPalindromePaths(**test_input) == 12

test_input = { "parent": [-1,5,5,5,5,0], "s": "ketewj" }
assert my_solution.countPalindromePaths(**test_input) == 6

test_input = { "parent": [-1,0,4,0,0], "s": "zrrqq" }
assert my_solution.countPalindromePaths(**test_input) == 7

test_input = { "parent": [-1,0,0], "s": "qlw" }
assert my_solution.countPalindromePaths(**test_input) == 2

test_input = { "parent": [-1,0,0], "s": "bds" }
assert my_solution.countPalindromePaths(**test_input) == 2

test_input = { "parent": [-1,2,6,6,0,4,4,2], "s": "odggsrsp" }
assert my_solution.countPalindromePaths(**test_input) == 13

test_input = { "parent": [-1,0,1], "s": "ldk" }
assert my_solution.countPalindromePaths(**test_input) == 2

test_input = { "parent": [-1,0,7,0,6,2,3,3,3], "s": "elllffflv" }
assert my_solution.countPalindromePaths(**test_input) == 28

test_input = { "parent": [-1,4,4,0,0], "s": "ntzhc" }
assert my_solution.countPalindromePaths(**test_input) == 4

test_input = { "parent": [-1,5,4,1,1,0,4], "s": "gmcmavf" }
assert my_solution.countPalindromePaths(**test_input) == 8

test_input = { "parent": [-1,0,0,4,0], "s": "aogkg" }
assert my_solution.countPalindromePaths(**test_input) == 6

test_input = { "parent": [-1,2,0], "s": "xmt" }
assert my_solution.countPalindromePaths(**test_input) == 2

test_input = { "parent": [-1,2,0], "s": "dff" }
assert my_solution.countPalindromePaths(**test_input) == 3

test_input = { "parent": [-1,0,1,1], "s": "lsvw" }
assert my_solution.countPalindromePaths(**test_input) == 3

test_input = { "parent": [-1,0,0], "s": "ovi" }
assert my_solution.countPalindromePaths(**test_input) == 2

test_input = { "parent": [-1,6,0,5,2,2,0,3], "s": "lpnfznpf" }
assert my_solution.countPalindromePaths(**test_input) == 19

test_input = { "parent": [-1,7,5,5,0,0,2,2], "s": "hqitxxwi" }
assert my_solution.countPalindromePaths(**test_input) == 16

test_input = { "parent": [-1,2,0], "s": "pyw" }
assert my_solution.countPalindromePaths(**test_input) == 2

test_input = { "parent": [-1,0,0,0], "s": "ybfa" }
assert my_solution.countPalindromePaths(**test_input) == 3

test_input = { "parent": [-1,3,6,6,6,0,0,4], "s": "ulicllkc" }
assert my_solution.countPalindromePaths(**test_input) == 11

test_input = { "parent": [-1,3,1,0], "s": "ukne" }
assert my_solution.countPalindromePaths(**test_input) == 3

test_input = { "parent": [-1,2,0,1,0,0], "s": "rhlxdd" }
assert my_solution.countPalindromePaths(**test_input) == 6

test_input = { "parent": [-1,4,5,0,2,0], "s": "zenbnb" }
assert my_solution.countPalindromePaths(**test_input) == 12

test_input = { "parent": [-1,0,5,4,5,1,3,9,7,4], "s": "jigognjnlb" }
assert my_solution.countPalindromePaths(**test_input) == 12

test_input = { "parent": [-1,4,4,6,3,0,5,3,6], "s": "imrcmdkew" }
assert my_solution.countPalindromePaths(**test_input) == 11

test_input = { "parent": [-1,4,4,0,6,4,0,0], "s": "dqpipiyz" }
assert my_solution.countPalindromePaths(**test_input) == 9

test_input = { "parent": [-1,0,0], "s": "mgm" }
assert my_solution.countPalindromePaths(**test_input) == 2

test_input = { "parent": [-1,0,4,0,1], "s": "pzlob" }
assert my_solution.countPalindromePaths(**test_input) == 4

test_input = { "parent": [-1,8,0,8,8,3,4,4,0,6], "s": "vvbvyovyvy" }
assert my_solution.countPalindromePaths(**test_input) == 30

test_input = { "parent": [-1,0,4,0,5,1,1], "s": "dvrvpea" }
assert my_solution.countPalindromePaths(**test_input) == 9

test_input = { "parent": [-1,0,1], "s": "jnx" }
assert my_solution.countPalindromePaths(**test_input) == 2

test_input = { "parent": [-1,0,1,2], "s": "wxjj" }
assert my_solution.countPalindromePaths(**test_input) == 5

test_input = { "parent": [-1,3,3,0,1,2,1], "s": "erorchx" }
assert my_solution.countPalindromePaths(**test_input) == 9

test_input = { "parent": [-1,0,4,1,1,4,3], "s": "ywzwzcw" }
assert my_solution.countPalindromePaths(**test_input) == 14

test_input = { "parent": [-1,4,6,2,3,3,0], "s": "bititzq" }
assert my_solution.countPalindromePaths(**test_input) == 10

test_input = { "parent": [-1,2,0], "s": "uup" }
assert my_solution.countPalindromePaths(**test_input) == 2

test_input = { "parent": [-1,2,3,0,0], "s": "siiou" }
assert my_solution.countPalindromePaths(**test_input) == 6

test_input = { "parent": [-1,2,0,2,0], "s": "dilfs" }
assert my_solution.countPalindromePaths(**test_input) == 4

test_input = { "parent": [-1,3,7,0,1,0,2,3,0], "s": "wqojvjoqq" }
assert my_solution.countPalindromePaths(**test_input) == 22

test_input = { "parent": [-1,0], "s": "hi" }
assert my_solution.countPalindromePaths(**test_input) == 1

test_input = { "parent": [-1,3,1,4,0,6,3,1], "s": "fwvwwqqw" }
assert my_solution.countPalindromePaths(**test_input) == 21

test_input = { "parent": [-1,0,4,2,1,1,1], "s": "hkmmkmk" }
assert my_solution.countPalindromePaths(**test_input) == 16

test_input = { "parent": [-1,4,3,1,0], "s": "bzeez" }
assert my_solution.countPalindromePaths(**test_input) == 9

test_input = { "parent": [-1,3,3,0], "s": "zyuj" }
assert my_solution.countPalindromePaths(**test_input) == 3

test_input = { "parent": [-1,0,1,4,6,2,2], "s": "tlcpcll" }
assert my_solution.countPalindromePaths(**test_input) == 13

test_input = { "parent": [-1,2,0], "s": "vjw" }
assert my_solution.countPalindromePaths(**test_input) == 2

test_input = { "parent": [-1,0], "s": "nz" }
assert my_solution.countPalindromePaths(**test_input) == 1

test_input = { "parent": [-1,0,0], "s": "iot" }
assert my_solution.countPalindromePaths(**test_input) == 2

test_input = { "parent": [-1,2,8,8,3,1,2,0,0], "s": "rlurrluxm" }
assert my_solution.countPalindromePaths(**test_input) == 19

test_input = { "parent": [-1,5,0,0,0,4], "s": "zxrddx" }
assert my_solution.countPalindromePaths(**test_input) == 10

test_input = { "parent": [-1,0,1,2], "s": "tffc" }
assert my_solution.countPalindromePaths(**test_input) == 5

test_input = { "parent": [-1,5,3,0,3,0], "s": "ltdewr" }
assert my_solution.countPalindromePaths(**test_input) == 5

test_input = { "parent": [-1,0,4,5,0,1], "s": "gjwwjv" }
assert my_solution.countPalindromePaths(**test_input) == 9

test_input = { "parent": [-1,7,7,0,8,2,2,4,3,8], "s": "cnssgsoogy" }
assert my_solution.countPalindromePaths(**test_input) == 20

test_input = { "parent": [-1,7,1,6,0,0,7,0], "s": "zaceoxax" }
assert my_solution.countPalindromePaths(**test_input) == 13

test_input = { "parent": [-1,0,1,0,3,0], "s": "zrvyyc" }
assert my_solution.countPalindromePaths(**test_input) == 8

test_input = { "parent": [-1,4,9,0,3,3,7,4,2,0], "s": "qxixxxxxix" }
assert my_solution.countPalindromePaths(**test_input) == 41

test_input = { "parent": [-1,2,0,5,5,2,5], "s": "hoptvuu" }
assert my_solution.countPalindromePaths(**test_input) == 9

test_input = { "parent": [-1,7,3,0,3,1,0,3], "s": "kopflpao" }
assert my_solution.countPalindromePaths(**test_input) == 13

test_input = { "parent": [-1,0,1,6,1,1,1], "s": "bhhslhl" }
assert my_solution.countPalindromePaths(**test_input) == 11

test_input = { "parent": [-1,0,0,1,2], "s": "khhch" }
assert my_solution.countPalindromePaths(**test_input) == 8

test_input = { "parent": [-1,0,3,0], "s": "koss" }
assert my_solution.countPalindromePaths(**test_input) == 5

test_input = { "parent": [-1,3,4,4,0], "s": "owzoq" }
assert my_solution.countPalindromePaths(**test_input) == 4

test_input = { "parent": [-1,2,0,1,1], "s": "zqqww" }
assert my_solution.countPalindromePaths(**test_input) == 8

test_input = { "parent": [-1,0,1,1,1,2,2], "s": "lacccdb" }
assert my_solution.countPalindromePaths(**test_input) == 13

test_input = { "parent": [-1,4,3,4,6,6,7,0,6], "s": "sjoooorrm" }
assert my_solution.countPalindromePaths(**test_input) == 24

test_input = { "parent": [-1,7,4,2,0,6,2,3,7], "s": "guqyxxtau" }
assert my_solution.countPalindromePaths(**test_input) == 9

test_input = { "parent": [-1,4,4,0,0], "s": "scicc" }
assert my_solution.countPalindromePaths(**test_input) == 8

test_input = { "parent": [-1,5,8,6,3,0,2,3,1], "s": "naphhahhp" }
assert my_solution.countPalindromePaths(**test_input) == 29

test_input = { "parent": [-1,3,8,8,5,0,4,0,0,2], "s": "ciiyggofij" }
assert my_solution.countPalindromePaths(**test_input) == 23

test_input = { "parent": [-1,2,0,2,2,3,7,8,4,2], "s": "stthtthddt" }
assert my_solution.countPalindromePaths(**test_input) == 34

test_input = { "parent": [-1,2,0,7,3,7,4,0], "s": "mjjsjdsj" }
assert my_solution.countPalindromePaths(**test_input) == 18

test_input = { "parent": [-1,0], "s": "ey" }
assert my_solution.countPalindromePaths(**test_input) == 1


check-if-array-is-good

Check if Array is Good

Prompt:
"""
给你一个整数数组 nums ，如果它是数组 base[n] 的一个排列，我们称它是个 好 数组。

base[n] = [1, 2, ..., n - 1, n, n] （换句话说，它是一个长度为 n + 1 且包含 1 到 n - 1 恰好各一次，包含 n  两次的一个数组）。比方说，base[1] = [1, 1] ，base[3] = [1, 2, 3, 3] 。

如果数组是一个好数组，请你返回 true ，否则返回 false 。

注意：数组的排列是这些数字按任意顺序排布后重新得到的数组。

示例 1：

输入：nums = [2, 1, 3]
输出：false
解释：因为数组的最大元素是 3 ，唯一可以构成这个数组的 base[n] 对应的 n = 3 。但是 base[3] 有 4 个元素，但数组 nums 只有 3 个元素，所以无法得到 base[3] = [1, 2, 3, 3] 的排列，所以答案为 false 。

示例 2：

输入：nums = [1, 3, 3, 2]
输出：true
解释：因为数组的最大元素是 3 ，唯一可以构成这个数组的 base[n] 对应的 n = 3 ，可以看出数组是 base[3] = [1, 2, 3, 3] 的一个排列（交换 nums 中第二个和第四个元素）。所以答案为 true 。

示例 3：

输入：nums = [1, 1]
输出：true
解释：因为数组的最大元素是 1 ，唯一可以构成这个数组的 base[n] 对应的 n = 1，可以看出数组是 base[1] = [1, 1] 的一个排列。所以答案为 true 。

示例 4：

输入：nums = [3, 4, 4, 1, 2, 1]
输出：false
解释：因为数组的最大元素是 4 ，唯一可以构成这个数组的 base[n] 对应的 n = 4 。但是 base[n] 有 5 个元素而 nums 有 6 个元素。所以答案为 false 。

提示：

 * 1 <= nums.length <= 100
 * 1 <= num[i] <= 200
"""
class Solution:
    def isGood(self, nums: List[int]) -> bool:

给你一个整数数组 nums ，如果它是数组 base[n] 的一个排列，我们称它是个 好 数组。

base[n] = [1, 2, ..., n - 1, n, n] （换句话说，它是一个长度为 n + 1 且包含 1 到 n - 1 恰好各一次，包含 n  两次的一个数组）。比方说，base[1] = [1, 1] ，base[3] = [1, 2, 3, 3] 。

如果数组是一个好数组，请你返回 true ，否则返回 false 。

注意：数组的排列是这些数字按任意顺序排布后重新得到的数组。

示例 1：

输入：nums = [2, 1, 3]
输出：false
解释：因为数组的最大元素是 3 ，唯一可以构成这个数组的 base[n] 对应的 n = 3 。但是 base[3] 有 4 个元素，但数组 nums 只有 3 个元素，所以无法得到 base[3] = [1, 2, 3, 3] 的排列，所以答案为 false 。

示例 2：

输入：nums = [1, 3, 3, 2]
输出：true
解释：因为数组的最大元素是 3 ，唯一可以构成这个数组的 base[n] 对应的 n = 3 ，可以看出数组是 base[3] = [1, 2, 3, 3] 的一个排列（交换 nums 中第二个和第四个元素）。所以答案为 true 。

示例 3：

输入：nums = [1, 1]
输出：true
解释：因为数组的最大元素是 1 ，唯一可以构成这个数组的 base[n] 对应的 n = 1，可以看出数组是 base[1] = [1, 1] 的一个排列。所以答案为 true 。

示例 4：

输入：nums = [3, 4, 4, 1, 2, 1]
输出：false
解释：因为数组的最大元素是 4 ，唯一可以构成这个数组的 base[n] 对应的 n = 4 。但是 base[n] 有 5 个元素而 nums 有 6 个元素。所以答案为 false 。

提示：

 * 1 <= nums.length <= 100
 * 1 <= num[i] <= 200

请完成下面的代码来解决上述问题:
```python
class Solution:
    def isGood(self, nums: List[int]) -> bool:

```

my_solution = Solution()

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

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

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

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

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

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

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

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

test_input = { "nums": [3] }
assert my_solution.isGood(**test_input) == False

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

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

test_input = { "nums": [4] }
assert my_solution.isGood(**test_input) == False

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

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

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

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

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

test_input = { "nums": [8] }
assert my_solution.isGood(**test_input) == False

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

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

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

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

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

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

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

test_input = { "nums": [12] }
assert my_solution.isGood(**test_input) == False

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

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

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

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

test_input = { "nums": [14] }
assert my_solution.isGood(**test_input) == False

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

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

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

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

test_input = { "nums": [82] }
assert my_solution.isGood(**test_input) == False

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

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

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

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

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

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

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

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

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

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

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

test_input = { "nums": [2, 9] }
assert my_solution.isGood(**test_input) == False

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

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

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

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

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

test_input = { "nums": [2, 12] }
assert my_solution.isGood(**test_input) == False

test_input = { "nums": [17, 1, 18, 11, 9, 4, 7, 6, 3, 21, 16, 14, 10, 8, 20, 21, 5, 2, 12, 19, 15, 13] }
assert my_solution.isGood(**test_input) == True

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

test_input = { "nums": [20, 13, 7, 10, 16, 12, 19, 2, 21, 17, 3, 11, 5, 15, 21, 1, 18, 6, 8, 14, 9, 4] }
assert my_solution.isGood(**test_input) == True

test_input = { "nums": [8, 19, 16, 17, 20, 15, 11, 4, 22, 3, 13, 10, 1, 18, 9, 12, 22, 7, 6, 2, 5, 21, 14] }
assert my_solution.isGood(**test_input) == True

test_input = { "nums": [22, 1, 17, 13, 8, 22, 9, 5, 21, 6, 14, 12, 10, 11, 2, 18, 4, 7, 19, 20, 3, 15, 16] }
assert my_solution.isGood(**test_input) == True

test_input = { "nums": [21, 15, 16, 13, 3, 4, 11, 22, 7, 14, 20, 10, 18, 17, 6, 8, 9, 1, 19, 5, 2, 12, 23, 24, 24] }
assert my_solution.isGood(**test_input) == True

test_input = { "nums": [22, 24, 24, 12, 17, 15, 14, 16, 8, 11, 23, 5, 2, 10, 6, 21, 9, 13, 3, 20, 19, 7, 4, 18, 1] }
assert my_solution.isGood(**test_input) == True

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

test_input = { "nums": [6, 16, 26, 9, 4, 24, 12, 26, 22, 3, 11, 23, 15, 2, 17, 5, 1, 21, 14, 19, 18, 20, 13, 25, 8, 7, 10] }
assert my_solution.isGood(**test_input) == True

test_input = { "nums": [29, 24, 5, 6, 4, 25, 9, 8, 21, 13, 27, 7, 20, 18, 3, 15, 23, 28, 29, 19, 17, 10, 22, 26, 1, 11, 12, 14, 16, 2] }
assert my_solution.isGood(**test_input) == True

test_input = { "nums": [25, 21, 6, 10, 20, 15, 16, 26, 7, 3, 30, 1, 12, 29, 11, 30, 14, 19, 2, 28, 23, 9, 8, 24, 17, 5, 4, 27, 22, 18, 13] }
assert my_solution.isGood(**test_input) == True

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

test_input = { "nums": [2, 25, 20, 30, 4, 6, 1, 29, 15, 11, 10, 19, 14, 12, 32, 3, 21, 27, 16, 17, 28, 13, 5, 32, 8, 24, 22, 7, 31, 23, 18, 26, 9] }
assert my_solution.isGood(**test_input) == True

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

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

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

test_input = { "nums": [5, 12] }
assert my_solution.isGood(**test_input) == False

test_input = { "nums": [5, 13] }
assert my_solution.isGood(**test_input) == False

test_input = { "nums": [4, 29, 5, 24, 19, 1, 8, 31, 18, 21, 9, 28, 32, 27, 10, 17, 22, 2, 11, 15, 13, 23, 6, 16, 7, 30, 12, 33, 14, 25, 33, 26, 3, 20] }
assert my_solution.isGood(**test_input) == True

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

test_input = { "nums": [30, 32, 1, 35, 19, 34, 4, 23, 18, 6, 11, 8, 22, 33, 31, 16, 17, 20, 24, 10, 21, 7, 14, 15, 29, 9, 12, 2, 36, 3, 26, 36, 5, 13, 25, 27, 28] }
assert my_solution.isGood(**test_input) == True

test_input = { "nums": [5, 34, 42, 17, 9, 44, 40, 24, 38, 21, 30, 14, 39, 11, 18, 36, 4, 43, 12, 32, 2, 6, 45, 46, 37, 47, 8, 3, 26, 1, 31, 28, 16, 20, 22, 35, 25, 15, 10, 29, 7, 27, 19, 33, 41, 47, 23, 13] }
assert my_solution.isGood(**test_input) == True

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

test_input = { "nums": [5, 41, 8, 2, 32, 24, 9, 44, 27, 6, 22, 36, 14, 21, 43, 28, 45, 37, 17, 18, 20, 26, 3, 12, 10, 33, 30, 13, 29, 38, 4, 47, 46, 15, 25, 11, 1, 19, 47, 16, 39, 31, 40, 34, 23, 7, 42, 35] }
assert my_solution.isGood(**test_input) == True

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

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

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

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

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

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

test_input = { "nums": [26, 35, 9, 3, 46, 33, 13, 8, 47, 27, 17, 40, 15, 20, 37, 12, 16, 44, 34, 2, 14, 30, 1, 29, 10, 11, 25, 18, 43, 42, 6, 5, 47, 38, 41, 32, 24, 31, 7, 4, 45, 19, 39, 22, 28, 36, 21, 23] }
assert my_solution.isGood(**test_input) == True

test_input = { "nums": [8, 9] }
assert my_solution.isGood(**test_input) == False

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

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

test_input = { "nums": [32, 39, 25, 49, 6, 48, 9, 7, 34, 3, 8, 26, 14, 27, 43, 30, 1, 21, 36, 10, 31, 38, 40, 12, 2, 46, 20, 15, 11, 24, 22, 28, 33, 4, 19, 18, 44, 41, 35, 29, 16, 37, 45, 47, 49, 23, 42, 13, 5, 17] }
assert my_solution.isGood(**test_input) == True

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

test_input = { "nums": [18, 35, 44, 41, 8, 33, 28, 9, 3, 14, 43, 56, 6, 10, 25, 53, 61, 22, 17, 23, 32, 50, 31, 13, 1, 29, 45, 34, 30, 48, 36, 58, 46, 15, 4, 7, 52, 60, 16, 12, 54, 19, 24, 40, 26, 55, 49, 42, 21, 38, 2, 20, 57, 61, 5, 37, 47, 27, 39, 11, 51, 59] }
assert my_solution.isGood(**test_input) == True

test_input = { "nums": [9, 9] }
assert my_solution.isGood(**test_input) == False

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

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

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

test_input = { "nums": [60, 62, 16, 59, 8, 49, 51, 41, 42, 40, 46, 3, 10, 13, 53, 2, 63, 54, 32, 33, 31, 14, 12, 15, 1, 66, 61, 18, 52, 4, 55, 11, 26, 28, 47, 21, 25, 43, 65, 58, 45, 50, 17, 64, 23, 22, 30, 9, 38, 19, 24, 44, 37, 39, 48, 20, 35, 36, 27, 34, 56, 57, 29, 5, 7, 6, 66] }
assert my_solution.isGood(**test_input) == True

test_input = { "nums": [46, 9, 21, 14, 24, 15, 6, 58, 22, 40, 63, 39, 49, 65, 30, 5, 43, 36, 29, 55, 67, 45, 61, 35, 67, 56, 16, 23, 50, 17, 19, 13, 26, 66, 47, 59, 2, 51, 27, 28, 31, 1, 44, 42, 53, 57, 11, 25, 4, 54, 37, 20, 48, 52, 41, 32, 10, 7, 64, 34, 60, 12, 33, 38, 3, 18, 62, 8] }
assert my_solution.isGood(**test_input) == True

test_input = { "nums": [11, 5] }
assert my_solution.isGood(**test_input) == False

test_input = { "nums": [57, 40, 35, 55, 42, 24, 43, 29, 30, 59, 21, 52, 67, 72, 32, 78, 13, 51, 36, 48, 74, 64, 69, 65, 9, 4, 37, 31, 6, 27, 7, 2, 38, 61, 15, 19, 71, 49, 44, 47, 46, 54, 76, 26, 63, 17, 22, 3, 16, 12, 18, 41, 25, 62, 8, 10, 23, 50, 56, 11, 20, 5, 28, 77, 66, 53, 14, 33, 68, 34, 73, 45, 1, 78, 39, 70, 75, 60, 58] }
assert my_solution.isGood(**test_input) == True

test_input = { "nums": [14, 38, 18, 10, 21, 9, 67, 68, 23, 19, 80, 13, 74, 75, 32, 55, 65, 45, 5, 28, 43, 8, 17, 42, 40, 44, 31, 1, 7, 25, 6, 47, 27, 50, 4, 76, 63, 52, 71, 34, 83, 56, 77, 81, 16, 12, 60, 79, 46, 41, 24, 35, 33, 2, 49, 70, 78, 36, 48, 69, 26, 66, 37, 72, 61, 30, 22, 58, 20, 39, 82, 64, 73, 59, 57, 3, 51, 29, 83, 53, 15, 54, 11, 62] }
assert my_solution.isGood(**test_input) == True


sort-vowels-in-a-string

Sort Vowels in a String

Prompt:
"""
给你一个下标从 0 开始的字符串 s ，将 s 中的元素重新 排列 得到新的字符串 t ，它满足：

 * 所有辅音字母都在原来的位置上。更正式的，如果满足 0 <= i < s.length 的下标 i 处的 s[i] 是个辅音字母，那么 t[i] = s[i] 。
 * 元音字母都必须以他们的 ASCII 值按 非递减 顺序排列。更正式的，对于满足 0 <= i < j < s.length 的下标 i 和 j  ，如果 s[i] 和 s[j] 都是元音字母，那么 t[i] 的 ASCII 值不能大于 t[j] 的 ASCII 值。

请你返回结果字母串。

元音字母为 'a' ，'e' ，'i' ，'o' 和 'u' ，它们可能是小写字母也可能是大写字母，辅音字母是除了这 5 个字母以外的所有字母。

示例 1：

输入：s = "lEetcOde"
输出："lEOtcede"
解释：'E' ，'O' 和 'e' 是 s 中的元音字母，'l' ，'t' ，'c' 和 'd' 是所有的辅音。将元音字母按照 ASCII 值排序，辅音字母留在原地。

示例 2：

输入：s = "lYmpH"
输出："lYmpH"
解释：s 中没有元音字母（s 中都为辅音字母），所以我们返回 "lYmpH" 。

提示：

 * 1 <= s.length <= 105
 * s 只包含英语字母表中的 大写 和 小写 字母。
"""
class Solution:
    def sortVowels(self, s: str) -> str:

给你一个下标从 0 开始的字符串 s ，将 s 中的元素重新 排列 得到新的字符串 t ，它满足：

 * 所有辅音字母都在原来的位置上。更正式的，如果满足 0 <= i < s.length 的下标 i 处的 s[i] 是个辅音字母，那么 t[i] = s[i] 。
 * 元音字母都必须以他们的 ASCII 值按 非递减 顺序排列。更正式的，对于满足 0 <= i < j < s.length 的下标 i 和 j  ，如果 s[i] 和 s[j] 都是元音字母，那么 t[i] 的 ASCII 值不能大于 t[j] 的 ASCII 值。

请你返回结果字母串。

元音字母为 'a' ，'e' ，'i' ，'o' 和 'u' ，它们可能是小写字母也可能是大写字母，辅音字母是除了这 5 个字母以外的所有字母。

示例 1：

输入：s = "lEetcOde"
输出："lEOtcede"
解释：'E' ，'O' 和 'e' 是 s 中的元音字母，'l' ，'t' ，'c' 和 'd' 是所有的辅音。将元音字母按照 ASCII 值排序，辅音字母留在原地。

示例 2：

输入：s = "lYmpH"
输出："lYmpH"
解释：s 中没有元音字母（s 中都为辅音字母），所以我们返回 "lYmpH" 。

提示：

 * 1 <= s.length <= 105
 * s 只包含英语字母表中的 大写 和 小写 字母。

请完成下面的代码来解决上述问题:
```python
class Solution:
    def sortVowels(self, s: str) -> str:

```

my_solution = Solution()

test_input = { "s": "lEetcOde" }
assert my_solution.sortVowels(**test_input) == "lEOtcede"

test_input = { "s": "lYmpH" }
assert my_solution.sortVowels(**test_input) == "lYmpH"

test_input = { "s": "mDVD" }
assert my_solution.sortVowels(**test_input) == "mDVD"

test_input = { "s": "xdX" }
assert my_solution.sortVowels(**test_input) == "xdX"

test_input = { "s": "xdE" }
assert my_solution.sortVowels(**test_input) == "xdE"

test_input = { "s": "RiQYo" }
assert my_solution.sortVowels(**test_input) == "RiQYo"

test_input = { "s": "LQRamBOHfq" }
assert my_solution.sortVowels(**test_input) == "LQROmBaHfq"

test_input = { "s": "UpjPbEnOj" }
assert my_solution.sortVowels(**test_input) == "EpjPbOnUj"

test_input = { "s": "ziF" }
assert my_solution.sortVowels(**test_input) == "ziF"

test_input = { "s": "WxkKdjhL" }
assert my_solution.sortVowels(**test_input) == "WxkKdjhL"

test_input = { "s": "uZcPmqAd" }
assert my_solution.sortVowels(**test_input) == "AZcPmqud"

test_input = { "s": "UjshJXjkjS" }
assert my_solution.sortVowels(**test_input) == "UjshJXjkjS"

test_input = { "s": "nElwWTQHJ" }
assert my_solution.sortVowels(**test_input) == "nElwWTQHJ"

test_input = { "s": "kwcJqvsgM" }
assert my_solution.sortVowels(**test_input) == "kwcJqvsgM"

test_input = { "s": "z" }
assert my_solution.sortVowels(**test_input) == "z"

test_input = { "s": "Pz" }
assert my_solution.sortVowels(**test_input) == "Pz"

test_input = { "s": "T" }
assert my_solution.sortVowels(**test_input) == "T"

test_input = { "s": "syRWvFi" }
assert my_solution.sortVowels(**test_input) == "syRWvFi"

test_input = { "s": "G" }
assert my_solution.sortVowels(**test_input) == "G"

test_input = { "s": "MuQYHVy" }
assert my_solution.sortVowels(**test_input) == "MuQYHVy"

test_input = { "s": "gsc" }
assert my_solution.sortVowels(**test_input) == "gsc"

test_input = { "s": "nynBd" }
assert my_solution.sortVowels(**test_input) == "nynBd"

test_input = { "s": "qUSUCJeJZt" }
assert my_solution.sortVowels(**test_input) == "qUSUCJeJZt"

test_input = { "s": "PoEvPD" }
assert my_solution.sortVowels(**test_input) == "PEovPD"

test_input = { "s": "SrSuArHDvA" }
assert my_solution.sortVowels(**test_input) == "SrSAArHDvu"

test_input = { "s": "zI" }
assert my_solution.sortVowels(**test_input) == "zI"

test_input = { "s": "zpVZt" }
assert my_solution.sortVowels(**test_input) == "zpVZt"

test_input = { "s": "dZVLG" }
assert my_solution.sortVowels(**test_input) == "dZVLG"

test_input = { "s": "EHhQZGJBbp" }
assert my_solution.sortVowels(**test_input) == "EHhQZGJBbp"

test_input = { "s": "aPLCji" }
assert my_solution.sortVowels(**test_input) == "aPLCji"

test_input = { "s": "HSe" }
assert my_solution.sortVowels(**test_input) == "HSe"

test_input = { "s": "HvDMPPU" }
assert my_solution.sortVowels(**test_input) == "HvDMPPU"

test_input = { "s": "LYACGrvJLZ" }
assert my_solution.sortVowels(**test_input) == "LYACGrvJLZ"

test_input = { "s": "RepLvwHFI" }
assert my_solution.sortVowels(**test_input) == "RIpLvwHFe"

test_input = { "s": "vjbObvLfs" }
assert my_solution.sortVowels(**test_input) == "vjbObvLfs"

test_input = { "s": "sKQwLo" }
assert my_solution.sortVowels(**test_input) == "sKQwLo"

test_input = { "s": "PoqU" }
assert my_solution.sortVowels(**test_input) == "PUqo"

test_input = { "s": "QgUxRvJTfH" }
assert my_solution.sortVowels(**test_input) == "QgUxRvJTfH"

test_input = { "s": "wUMnwnblpu" }
assert my_solution.sortVowels(**test_input) == "wUMnwnblpu"

test_input = { "s": "JpqXrPuMd" }
assert my_solution.sortVowels(**test_input) == "JpqXrPuMd"

test_input = { "s": "wdtDPSQdKl" }
assert my_solution.sortVowels(**test_input) == "wdtDPSQdKl"

test_input = { "s": "Dl" }
assert my_solution.sortVowels(**test_input) == "Dl"

test_input = { "s": "v" }
assert my_solution.sortVowels(**test_input) == "v"

test_input = { "s": "axRukCyOHm" }
assert my_solution.sortVowels(**test_input) == "OxRakCyuHm"

test_input = { "s": "sQyytiAh" }
assert my_solution.sortVowels(**test_input) == "sQyytAih"

test_input = { "s": "ieTwHeOR" }
assert my_solution.sortVowels(**test_input) == "OeTwHeiR"

test_input = { "s": "LLxyZ" }
assert my_solution.sortVowels(**test_input) == "LLxyZ"

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

test_input = { "s": "oefu" }
assert my_solution.sortVowels(**test_input) == "eofu"

test_input = { "s": "XV" }
assert my_solution.sortVowels(**test_input) == "XV"

test_input = { "s": "VkfjDpSH" }
assert my_solution.sortVowels(**test_input) == "VkfjDpSH"

test_input = { "s": "rg" }
assert my_solution.sortVowels(**test_input) == "rg"

test_input = { "s": "ecV" }
assert my_solution.sortVowels(**test_input) == "ecV"

test_input = { "s": "RUnxytMua" }
assert my_solution.sortVowels(**test_input) == "RUnxytMau"

test_input = { "s": "gUyMeyzOZo" }
assert my_solution.sortVowels(**test_input) == "gOyMUyzeZo"

test_input = { "s": "WEir" }
assert my_solution.sortVowels(**test_input) == "WEir"

test_input = { "s": "zZWs" }
assert my_solution.sortVowels(**test_input) == "zZWs"

test_input = { "s": "WULsDqIhp" }
assert my_solution.sortVowels(**test_input) == "WILsDqUhp"

test_input = { "s": "pw" }
assert my_solution.sortVowels(**test_input) == "pw"

test_input = { "s": "nOWxdSzo" }
assert my_solution.sortVowels(**test_input) == "nOWxdSzo"

test_input = { "s": "NfK" }
assert my_solution.sortVowels(**test_input) == "NfK"

test_input = { "s": "wXRFu" }
assert my_solution.sortVowels(**test_input) == "wXRFu"

test_input = { "s": "XXtjDoinAD" }
assert my_solution.sortVowels(**test_input) == "XXtjDAinoD"

test_input = { "s": "SGUzEv" }
assert my_solution.sortVowels(**test_input) == "SGEzUv"

test_input = { "s": "RFOvEt" }
assert my_solution.sortVowels(**test_input) == "RFEvOt"

test_input = { "s": "umQePdr" }
assert my_solution.sortVowels(**test_input) == "emQuPdr"

test_input = { "s": "wRqZ" }
assert my_solution.sortVowels(**test_input) == "wRqZ"

test_input = { "s": "blu" }
assert my_solution.sortVowels(**test_input) == "blu"

test_input = { "s": "QeOQEatFaW" }
assert my_solution.sortVowels(**test_input) == "QEOQaatFeW"

test_input = { "s": "jzWiXrYa" }
assert my_solution.sortVowels(**test_input) == "jzWaXrYi"

test_input = { "s": "xs" }
assert my_solution.sortVowels(**test_input) == "xs"

test_input = { "s": "DwROc" }
assert my_solution.sortVowels(**test_input) == "DwROc"

test_input = { "s": "XMhLlJd" }
assert my_solution.sortVowels(**test_input) == "XMhLlJd"

test_input = { "s": "uAmir" }
assert my_solution.sortVowels(**test_input) == "Aimur"

test_input = { "s": "PTlFpeAI" }
assert my_solution.sortVowels(**test_input) == "PTlFpAIe"

test_input = { "s": "XLYy" }
assert my_solution.sortVowels(**test_input) == "XLYy"

test_input = { "s": "vA" }
assert my_solution.sortVowels(**test_input) == "vA"

test_input = { "s": "y" }
assert my_solution.sortVowels(**test_input) == "y"

test_input = { "s": "C" }
assert my_solution.sortVowels(**test_input) == "C"

test_input = { "s": "wrnMlek" }
assert my_solution.sortVowels(**test_input) == "wrnMlek"

test_input = { "s": "JWbfCfGgf" }
assert my_solution.sortVowels(**test_input) == "JWbfCfGgf"

test_input = { "s": "OPGlnq" }
assert my_solution.sortVowels(**test_input) == "OPGlnq"

test_input = { "s": "DeOMW" }
assert my_solution.sortVowels(**test_input) == "DOeMW"

test_input = { "s": "xG" }
assert my_solution.sortVowels(**test_input) == "xG"

test_input = { "s": "ZcaBhfkWC" }
assert my_solution.sortVowels(**test_input) == "ZcaBhfkWC"

test_input = { "s": "pKa" }
assert my_solution.sortVowels(**test_input) == "pKa"

test_input = { "s": "DXSEKrfJCe" }
assert my_solution.sortVowels(**test_input) == "DXSEKrfJCe"

test_input = { "s": "xA" }
assert my_solution.sortVowels(**test_input) == "xA"

test_input = { "s": "Jb" }
assert my_solution.sortVowels(**test_input) == "Jb"

test_input = { "s": "SBQT" }
assert my_solution.sortVowels(**test_input) == "SBQT"

test_input = { "s": "LWRfYb" }
assert my_solution.sortVowels(**test_input) == "LWRfYb"

test_input = { "s": "tvLWAeGDFK" }
assert my_solution.sortVowels(**test_input) == "tvLWAeGDFK"

test_input = { "s": "jFkj" }
assert my_solution.sortVowels(**test_input) == "jFkj"

test_input = { "s": "zC" }
assert my_solution.sortVowels(**test_input) == "zC"

test_input = { "s": "ikYSsAveh" }
assert my_solution.sortVowels(**test_input) == "AkYSsevih"

test_input = { "s": "YXkS" }
assert my_solution.sortVowels(**test_input) == "YXkS"

test_input = { "s": "SOEo" }
assert my_solution.sortVowels(**test_input) == "SEOo"

test_input = { "s": "qoJx" }
assert my_solution.sortVowels(**test_input) == "qoJx"

test_input = { "s": "qGJbgTQ" }
assert my_solution.sortVowels(**test_input) == "qGJbgTQ"

test_input = { "s": "yiYYO" }
assert my_solution.sortVowels(**test_input) == "yOYYi"


visit-array-positions-to-maximize-score

Visit Array Positions to Maximize Score

Prompt:
"""
给你一个下标从 0 开始的整数数组 nums 和一个正整数 x 。

你 一开始 在数组的位置 0 处，你可以按照下述规则访问数组中的其他位置：

 * 如果你当前在位置 i ，那么你可以移动到满足 i < j 的 任意 位置 j 。
 * 对于你访问的位置 i ，你可以获得分数 nums[i] 。
 * 如果你从位置 i 移动到位置 j 且 nums[i] 和 nums[j] 的 奇偶性 不同，那么你将失去分数 x 。

请你返回你能得到的 最大 得分之和。

注意 ，你一开始的分数为 nums[0] 。

示例 1：

输入：nums = [2,3,6,1,9,2], x = 5
输出：13
解释：我们可以按顺序访问数组中的位置：0 -> 2 -> 3 -> 4 。
对应位置的值为 2 ，6 ，1 和 9 。因为 6 和 1 的奇偶性不同，所以下标从 2 -> 3 让你失去 x = 5 分。
总得分为：2 + 6 + 1 + 9 - 5 = 13 。

示例 2：

输入：nums = [2,4,6,8], x = 3
输出：20
解释：数组中的所有元素奇偶性都一样，所以我们可以将每个元素都访问一次，而且不会失去任何分数。
总得分为：2 + 4 + 6 + 8 = 20 。

提示：

 * 2 <= nums.length <= 105
 * 1 <= nums[i], x <= 106
"""
class Solution:
    def maxScore(self, nums: List[int], x: int) -> int:

给你一个下标从 0 开始的整数数组 nums 和一个正整数 x 。

你 一开始 在数组的位置 0 处，你可以按照下述规则访问数组中的其他位置：

 * 如果你当前在位置 i ，那么你可以移动到满足 i < j 的 任意 位置 j 。
 * 对于你访问的位置 i ，你可以获得分数 nums[i] 。
 * 如果你从位置 i 移动到位置 j 且 nums[i] 和 nums[j] 的 奇偶性 不同，那么你将失去分数 x 。

请你返回你能得到的 最大 得分之和。

注意 ，你一开始的分数为 nums[0] 。

示例 1：

输入：nums = [2,3,6,1,9,2], x = 5
输出：13
解释：我们可以按顺序访问数组中的位置：0 -> 2 -> 3 -> 4 。
对应位置的值为 2 ，6 ，1 和 9 。因为 6 和 1 的奇偶性不同，所以下标从 2 -> 3 让你失去 x = 5 分。
总得分为：2 + 6 + 1 + 9 - 5 = 13 。

示例 2：

输入：nums = [2,4,6,8], x = 3
输出：20
解释：数组中的所有元素奇偶性都一样，所以我们可以将每个元素都访问一次，而且不会失去任何分数。
总得分为：2 + 4 + 6 + 8 = 20 。

提示：

 * 2 <= nums.length <= 105
 * 1 <= nums[i], x <= 106

请完成下面的代码来解决上述问题:
```python
class Solution:
    def maxScore(self, nums: List[int], x: int) -> int:

```


ways-to-express-an-integer-as-sum-of-powers

Ways to Express an Integer as Sum of Powers

Prompt:
"""
给你两个 正 整数 n 和 x 。

请你返回将 n 表示成一些 互不相同 正整数的 x 次幂之和的方案数。换句话说，你需要返回互不相同整数 [n1, n2, ..., nk] 的集合数目，满足 n = n1x + n2x + ... + nkx 。

由于答案可能非常大，请你将它对 109 + 7 取余后返回。

比方说，n = 160 且 x = 3 ，一个表示 n 的方法是 n = 23 + 33 + 53 。

示例 1：

输入：n = 10, x = 2
输出：1
解释：我们可以将 n 表示为：n = 32 + 12 = 10 。
这是唯一将 10 表达成不同整数 2 次方之和的方案。

示例 2：

输入：n = 4, x = 1
输出：2
解释：我们可以将 n 按以下方案表示：
- n = 41 = 4 。
- n = 31 + 11 = 4 。

提示：

 * 1 <= n <= 300
 * 1 <= x <= 5
"""
class Solution:
    def numberOfWays(self, n: int, x: int) -> int:

给你两个 正 整数 n 和 x 。

请你返回将 n 表示成一些 互不相同 正整数的 x 次幂之和的方案数。换句话说，你需要返回互不相同整数 [n1, n2, ..., nk] 的集合数目，满足 n = n1x + n2x + ... + nkx 。

由于答案可能非常大，请你将它对 109 + 7 取余后返回。

比方说，n = 160 且 x = 3 ，一个表示 n 的方法是 n = 23 + 33 + 53 。

示例 1：

输入：n = 10, x = 2
输出：1
解释：我们可以将 n 表示为：n = 32 + 12 = 10 。
这是唯一将 10 表达成不同整数 2 次方之和的方案。

示例 2：

输入：n = 4, x = 1
输出：2
解释：我们可以将 n 按以下方案表示：
- n = 41 = 4 。
- n = 31 + 11 = 4 。

提示：

 * 1 <= n <= 300
 * 1 <= x <= 5

请完成下面的代码来解决上述问题:
```python
class Solution:
    def numberOfWays(self, n: int, x: int) -> int:

```

my_solution = Solution()

test_input = { "n": 10, "x": 2 }
assert my_solution.numberOfWays(**test_input) == 1

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

test_input = { "n": 1, "x": 1 }
assert my_solution.numberOfWays(**test_input) == 1

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

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

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

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

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

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

test_input = { "n": 2, "x": 3 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 2, "x": 4 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 2, "x": 5 }
assert my_solution.numberOfWays(**test_input) == 0

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

test_input = { "n": 3, "x": 2 }
assert my_solution.numberOfWays(**test_input) == 0

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

test_input = { "n": 3, "x": 4 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 3, "x": 5 }
assert my_solution.numberOfWays(**test_input) == 0

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

test_input = { "n": 4, "x": 3 }
assert my_solution.numberOfWays(**test_input) == 0

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

test_input = { "n": 4, "x": 5 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 5, "x": 1 }
assert my_solution.numberOfWays(**test_input) == 3

test_input = { "n": 5, "x": 2 }
assert my_solution.numberOfWays(**test_input) == 1

test_input = { "n": 5, "x": 3 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 5, "x": 4 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 5, "x": 5 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 6, "x": 1 }
assert my_solution.numberOfWays(**test_input) == 4

test_input = { "n": 6, "x": 2 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 6, "x": 3 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 6, "x": 4 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 6, "x": 5 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 7, "x": 1 }
assert my_solution.numberOfWays(**test_input) == 5

test_input = { "n": 7, "x": 2 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 7, "x": 3 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 7, "x": 4 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 7, "x": 5 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 8, "x": 1 }
assert my_solution.numberOfWays(**test_input) == 6

test_input = { "n": 8, "x": 2 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 8, "x": 3 }
assert my_solution.numberOfWays(**test_input) == 1

test_input = { "n": 8, "x": 4 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 8, "x": 5 }
assert my_solution.numberOfWays(**test_input) == 0

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

test_input = { "n": 9, "x": 2 }
assert my_solution.numberOfWays(**test_input) == 1

test_input = { "n": 9, "x": 3 }
assert my_solution.numberOfWays(**test_input) == 1

test_input = { "n": 9, "x": 4 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 9, "x": 5 }
assert my_solution.numberOfWays(**test_input) == 0

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

test_input = { "n": 10, "x": 3 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 10, "x": 4 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 10, "x": 5 }
assert my_solution.numberOfWays(**test_input) == 0

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

test_input = { "n": 11, "x": 2 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 11, "x": 3 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 11, "x": 4 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 11, "x": 5 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 12, "x": 1 }
assert my_solution.numberOfWays(**test_input) == 15

test_input = { "n": 12, "x": 2 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 12, "x": 3 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 12, "x": 4 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 12, "x": 5 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 13, "x": 1 }
assert my_solution.numberOfWays(**test_input) == 18

test_input = { "n": 13, "x": 2 }
assert my_solution.numberOfWays(**test_input) == 1

test_input = { "n": 13, "x": 3 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 13, "x": 4 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 13, "x": 5 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 14, "x": 1 }
assert my_solution.numberOfWays(**test_input) == 22

test_input = { "n": 14, "x": 2 }
assert my_solution.numberOfWays(**test_input) == 1

test_input = { "n": 14, "x": 3 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 14, "x": 4 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 14, "x": 5 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 15, "x": 1 }
assert my_solution.numberOfWays(**test_input) == 27

test_input = { "n": 15, "x": 2 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 15, "x": 3 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 15, "x": 4 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 15, "x": 5 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 16, "x": 1 }
assert my_solution.numberOfWays(**test_input) == 32

test_input = { "n": 16, "x": 2 }
assert my_solution.numberOfWays(**test_input) == 1

test_input = { "n": 16, "x": 3 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 16, "x": 4 }
assert my_solution.numberOfWays(**test_input) == 1

test_input = { "n": 16, "x": 5 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 17, "x": 1 }
assert my_solution.numberOfWays(**test_input) == 38

test_input = { "n": 17, "x": 2 }
assert my_solution.numberOfWays(**test_input) == 1

test_input = { "n": 17, "x": 3 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 17, "x": 4 }
assert my_solution.numberOfWays(**test_input) == 1

test_input = { "n": 17, "x": 5 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 18, "x": 1 }
assert my_solution.numberOfWays(**test_input) == 46

test_input = { "n": 18, "x": 2 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 18, "x": 3 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 18, "x": 4 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 18, "x": 5 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 19, "x": 1 }
assert my_solution.numberOfWays(**test_input) == 54

test_input = { "n": 19, "x": 2 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 19, "x": 3 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 19, "x": 4 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 19, "x": 5 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 20, "x": 1 }
assert my_solution.numberOfWays(**test_input) == 64

test_input = { "n": 20, "x": 2 }
assert my_solution.numberOfWays(**test_input) == 1

test_input = { "n": 20, "x": 3 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 20, "x": 4 }
assert my_solution.numberOfWays(**test_input) == 0

test_input = { "n": 20, "x": 5 }
assert my_solution.numberOfWays(**test_input) == 0


sum-of-squares-of-special-elements

Sum of Squares of Special Elements

Prompt:
"""
给你一个下标从 1 开始、长度为 n 的整数数组 nums 。

对 nums 中的元素 nums[i] 而言，如果 n 能够被 i 整除，即 n % i == 0 ，则认为 num[i] 是一个 特殊元素 。

返回 nums 中所有 特殊元素 的 平方和 。

示例 1：

输入：nums = [1,2,3,4]
输出：21
解释：nums 中共有 3 个特殊元素：nums[1]，因为 4 被 1 整除；nums[2]，因为 4 被 2 整除；以及 nums[4]，因为 4 被 4 整除。
因此，nums 中所有特殊元素的平方和等于 nums[1] * nums[1] + nums[2] * nums[2] + nums[4] * nums[4] = 1 * 1 + 2 * 2 + 4 * 4 = 21 。

示例 2：

输入：nums = [2,7,1,19,18,3]
输出：63
解释：nums 中共有 4 个特殊元素：nums[1]，因为 6 被 1 整除；nums[2] ，因为 6 被 2 整除；nums[3]，因为 6 被 3 整除；以及 nums[6]，因为 6 被 6 整除。
因此，nums 中所有特殊元素的平方和等于 nums[1] * nums[1] + nums[2] * nums[2] + nums[3] * nums[3] + nums[6] * nums[6] = 2 * 2 + 7 * 7 + 1 * 1 + 3 * 3 = 63 。

提示：

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

给你一个下标从 1 开始、长度为 n 的整数数组 nums 。

对 nums 中的元素 nums[i] 而言，如果 n 能够被 i 整除，即 n % i == 0 ，则认为 num[i] 是一个 特殊元素 。

返回 nums 中所有 特殊元素 的 平方和 。

示例 1：

输入：nums = [1,2,3,4]
输出：21
解释：nums 中共有 3 个特殊元素：nums[1]，因为 4 被 1 整除；nums[2]，因为 4 被 2 整除；以及 nums[4]，因为 4 被 4 整除。
因此，nums 中所有特殊元素的平方和等于 nums[1] * nums[1] + nums[2] * nums[2] + nums[4] * nums[4] = 1 * 1 + 2 * 2 + 4 * 4 = 21 。

示例 2：

输入：nums = [2,7,1,19,18,3]
输出：63
解释：nums 中共有 4 个特殊元素：nums[1]，因为 6 被 1 整除；nums[2] ，因为 6 被 2 整除；nums[3]，因为 6 被 3 整除；以及 nums[6]，因为 6 被 6 整除。
因此，nums 中所有特殊元素的平方和等于 nums[1] * nums[1] + nums[2] * nums[2] + nums[3] * nums[3] + nums[6] * nums[6] = 2 * 2 + 7 * 7 + 1 * 1 + 3 * 3 = 63 。

提示：

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

请完成下面的代码来解决上述问题:
```python
class Solution:
    def sumOfSquares(self, nums: List[int]) -> int:

```

my_solution = Solution()

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

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

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

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

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

test_input = { "nums": [4] }
assert my_solution.sumOfSquares(**test_input) == 16

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

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

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

test_input = { "nums": [8] }
assert my_solution.sumOfSquares(**test_input) == 64

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

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

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

test_input = { "nums": [12] }
assert my_solution.sumOfSquares(**test_input) == 144

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

test_input = { "nums": [14] }
assert my_solution.sumOfSquares(**test_input) == 196

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

test_input = { "nums": [16] }
assert my_solution.sumOfSquares(**test_input) == 256

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

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

test_input = { "nums": [19] }
assert my_solution.sumOfSquares(**test_input) == 361

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

test_input = { "nums": [21] }
assert my_solution.sumOfSquares(**test_input) == 441

test_input = { "nums": [22] }
assert my_solution.sumOfSquares(**test_input) == 484

test_input = { "nums": [23] }
assert my_solution.sumOfSquares(**test_input) == 529

test_input = { "nums": [24] }
assert my_solution.sumOfSquares(**test_input) == 576

test_input = { "nums": [25] }
assert my_solution.sumOfSquares(**test_input) == 625

test_input = { "nums": [26] }
assert my_solution.sumOfSquares(**test_input) == 676

test_input = { "nums": [27] }
assert my_solution.sumOfSquares(**test_input) == 729

test_input = { "nums": [28] }
assert my_solution.sumOfSquares(**test_input) == 784

test_input = { "nums": [29] }
assert my_solution.sumOfSquares(**test_input) == 841

test_input = { "nums": [30] }
assert my_solution.sumOfSquares(**test_input) == 900

test_input = { "nums": [31] }
assert my_solution.sumOfSquares(**test_input) == 961

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

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

test_input = { "nums": [34] }
assert my_solution.sumOfSquares(**test_input) == 1156

test_input = { "nums": [35] }
assert my_solution.sumOfSquares(**test_input) == 1225

test_input = { "nums": [36] }
assert my_solution.sumOfSquares(**test_input) == 1296

test_input = { "nums": [37] }
assert my_solution.sumOfSquares(**test_input) == 1369

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

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

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

test_input = { "nums": [41] }
assert my_solution.sumOfSquares(**test_input) == 1681

test_input = { "nums": [42] }
assert my_solution.sumOfSquares(**test_input) == 1764

test_input = { "nums": [43] }
assert my_solution.sumOfSquares(**test_input) == 1849

test_input = { "nums": [44] }
assert my_solution.sumOfSquares(**test_input) == 1936

test_input = { "nums": [45] }
assert my_solution.sumOfSquares(**test_input) == 2025

test_input = { "nums": [46] }
assert my_solution.sumOfSquares(**test_input) == 2116

test_input = { "nums": [47] }
assert my_solution.sumOfSquares(**test_input) == 2209

test_input = { "nums": [48] }
assert my_solution.sumOfSquares(**test_input) == 2304

test_input = { "nums": [49] }
assert my_solution.sumOfSquares(**test_input) == 2401

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

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

test_input = { "nums": [13,36] }
assert my_solution.sumOfSquares(**test_input) == 1465

test_input = { "nums": [40,37] }
assert my_solution.sumOfSquares(**test_input) == 2969

test_input = { "nums": [33,42] }
assert my_solution.sumOfSquares(**test_input) == 2853

test_input = { "nums": [46,9] }
assert my_solution.sumOfSquares(**test_input) == 2197

test_input = { "nums": [30,14] }
assert my_solution.sumOfSquares(**test_input) == 1096

test_input = { "nums": [5,41] }
assert my_solution.sumOfSquares(**test_input) == 1706

test_input = { "nums": [17,9] }
assert my_solution.sumOfSquares(**test_input) == 370

test_input = { "nums": [29,21] }
assert my_solution.sumOfSquares(**test_input) == 1282

test_input = { "nums": [4,38] }
assert my_solution.sumOfSquares(**test_input) == 1460

test_input = { "nums": [14,18] }
assert my_solution.sumOfSquares(**test_input) == 520

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

test_input = { "nums": [11,36] }
assert my_solution.sumOfSquares(**test_input) == 1417

test_input = { "nums": [18,26] }
assert my_solution.sumOfSquares(**test_input) == 1000

test_input = { "nums": [37,46] }
assert my_solution.sumOfSquares(**test_input) == 3485

test_input = { "nums": [13,33] }
assert my_solution.sumOfSquares(**test_input) == 1258

test_input = { "nums": [39,1] }
assert my_solution.sumOfSquares(**test_input) == 1522

test_input = { "nums": [37,16] }
assert my_solution.sumOfSquares(**test_input) == 1625

test_input = { "nums": [22,34] }
assert my_solution.sumOfSquares(**test_input) == 1640

test_input = { "nums": [4,50] }
assert my_solution.sumOfSquares(**test_input) == 2516

test_input = { "nums": [42,40] }
assert my_solution.sumOfSquares(**test_input) == 3364

test_input = { "nums": [7,44] }
assert my_solution.sumOfSquares(**test_input) == 1985

test_input = { "nums": [21,27] }
assert my_solution.sumOfSquares(**test_input) == 1170

test_input = { "nums": [49,35] }
assert my_solution.sumOfSquares(**test_input) == 3626

test_input = { "nums": [32,20] }
assert my_solution.sumOfSquares(**test_input) == 1424

test_input = { "nums": [30,12] }
assert my_solution.sumOfSquares(**test_input) == 1044

test_input = { "nums": [50,42] }
assert my_solution.sumOfSquares(**test_input) == 4264

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

test_input = { "nums": [38,17] }
assert my_solution.sumOfSquares(**test_input) == 1733

test_input = { "nums": [50,32] }
assert my_solution.sumOfSquares(**test_input) == 3524

test_input = { "nums": [12,35] }
assert my_solution.sumOfSquares(**test_input) == 1369

test_input = { "nums": [9,32] }
assert my_solution.sumOfSquares(**test_input) == 1105

test_input = { "nums": [6,11] }
assert my_solution.sumOfSquares(**test_input) == 157

test_input = { "nums": [11,39] }
assert my_solution.sumOfSquares(**test_input) == 1642

test_input = { "nums": [18,29] }
assert my_solution.sumOfSquares(**test_input) == 1165

test_input = { "nums": [44,29] }
assert my_solution.sumOfSquares(**test_input) == 2777

test_input = { "nums": [50,13] }
assert my_solution.sumOfSquares(**test_input) == 2669

test_input = { "nums": [46,46] }
assert my_solution.sumOfSquares(**test_input) == 4232

test_input = { "nums": [27,5] }
assert my_solution.sumOfSquares(**test_input) == 754

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

test_input = { "nums": [10,46] }
assert my_solution.sumOfSquares(**test_input) == 2216

test_input = { "nums": [37,32] }
assert my_solution.sumOfSquares(**test_input) == 2393

test_input = { "nums": [26,33] }
assert my_solution.sumOfSquares(**test_input) == 1765

test_input = { "nums": [44,3] }
assert my_solution.sumOfSquares(**test_input) == 1945

test_input = { "nums": [9,16] }
assert my_solution.sumOfSquares(**test_input) == 337

test_input = { "nums": [7,21] }
assert my_solution.sumOfSquares(**test_input) == 490

test_input = { "nums": [23,33] }
assert my_solution.sumOfSquares(**test_input) == 1618

test_input = { "nums": [22,5] }
assert my_solution.sumOfSquares(**test_input) == 509