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 494ac1e commit d44325dCopy full SHA for d44325d
src/code/python/sorting_algorithms/pancake_sort.py
@@ -1,7 +1,7 @@
1
def pancake_sort(arr: list) -> None:
2
n = len(arr)
3
4
- for size in range(n, 1, -1):
+ for size in reversed(range(2, n + 1)):
5
max_idx = find_max_index(arr, size)
6
7
if max_idx != size - 1:
0 commit comments