diff --git a/sorts/pancake_sort.py b/sorts/pancake_sort.py index e5d600738435..7fa4c02e981f 100644 --- a/sorts/pancake_sort.py +++ b/sorts/pancake_sort.py @@ -8,8 +8,13 @@ python pancake_sort.py """ +from collections.abc import Sequence +from typing import TypeVar -def pancake_sort(arr): +T = TypeVar("T") + + +def pancake_sort[T](arr: Sequence[T]) -> list[T]: """Sort Array with Pancake Sort. :param arr: Collection containing comparable items :return: Collection ordered in ascending order of items