Skip to content

Commit 65c2b2e

Browse files
authored
Merge branch 'master' into python-3.14t
2 parents 168b56e + 310bb4c commit 65c2b2e

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

sorts/pancake_sort.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@
88
python pancake_sort.py
99
"""
1010

11+
from collections.abc import Sequence
12+
from typing import TypeVar
1113

12-
def pancake_sort(arr):
14+
T = TypeVar("T")
15+
16+
17+
def pancake_sort[T](arr: Sequence[T]) -> list[T]:
1318
"""Sort Array with Pancake Sort.
1419
:param arr: Collection containing comparable items
1520
:return: Collection ordered in ascending order of items

0 commit comments

Comments
 (0)