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 c2b2c4d commit ab95c61Copy full SHA for ab95c61
sorts/merge_sort.py
@@ -40,17 +40,17 @@ def merge(left: list, right: list) -> list:
40
left_length = len(left)
41
right_length = len(right)
42
left_index = right_index = 0
43
-
+
44
while (left_index < left_length) and (right_index < right_length):
45
if left[left_index] < right[right_index]:
46
result.append(left[left_index])
47
left_index += 1
48
else:
49
result.append(right[right_index])
50
right_index += 1
51
52
- result.extend(left[left_index : ])
53
- result.extend(right[right_index : ])
+ result.extend(left[left_index:])
+ result.extend(right[right_index:])
54
return result
55
56
if len(collection) <= 1:
0 commit comments