There was an error while loading. Please reload this page.
2 parents 168b56e + 310bb4c commit 65c2b2eCopy full SHA for 65c2b2e
1 file changed
sorts/pancake_sort.py
@@ -8,8 +8,13 @@
8
python pancake_sort.py
9
"""
10
11
+from collections.abc import Sequence
12
+from typing import TypeVar
13
-def pancake_sort(arr):
14
+T = TypeVar("T")
15
+
16
17
+def pancake_sort[T](arr: Sequence[T]) -> list[T]:
18
"""Sort Array with Pancake Sort.
19
:param arr: Collection containing comparable items
20
:return: Collection ordered in ascending order of items
0 commit comments