We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 33ffba8 commit 3e0deb7Copy full SHA for 3e0deb7
data_structures/arrays/dutch_national_flag_sort.py
@@ -84,20 +84,21 @@ def dutch_flag_sort(arr: list[int]) -> None:
84
arr[mid], arr[high] = arr[high], arr[mid]
85
high -= 1
86
else:
87
- raise ValueError(f"Array contains invalid value: {value}")
+ msg = f"Array contains invalid value: {value}"
88
+ raise ValueError(msg)
89
90
91
if __name__ == "__main__":
92
examples = [
- ([2, 0, 2, 1, 1, 0],),
93
- ([2, 0, 1],),
94
- ([],),
95
- ([1],),
96
- ([0, 0, 0],),
97
- ([2, 2, 2],),
98
- ([1, 1, 1],),
99
- ([0, 1, 2, 0, 1, 2],),
100
- ([2, 1, 0, 2, 1, 0],),
+ [2, 0, 2, 1, 1, 0],
+ [2, 0, 1],
+ [],
+ [1],
+ [0, 0, 0],
+ [2, 2, 2],
+ [1, 1, 1],
+ [0, 1, 2, 0, 1, 2],
101
+ [2, 1, 0, 2, 1, 0],
102
]
103
104
for test_arr in examples:
0 commit comments