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 af84c75 commit 22e5570Copy full SHA for 22e5570
sorts/reversort.py
@@ -91,7 +91,7 @@ def reversort(collection: list[Any]) -> list[Any]:
91
92
# Reverse the subarray from position i to min_index
93
if min_index != i:
94
- arr[i:min_index + 1] = arr[i:min_index + 1][::-1]
+ arr[i : min_index + 1] = arr[i : min_index + 1][::-1]
95
96
return arr
97
@@ -132,7 +132,7 @@ def reversort_cost(collection: list[Any]) -> int:
132
min_index = j
133
134
135
136
137
# Cost is the length of the reversed segment
138
total_cost += min_index - i + 1
0 commit comments