From 81fcb90f7b7f88bb4b9bbc1f85967b5f26840fda Mon Sep 17 00:00:00 2001 From: Aarav Arya <159852168+Aarav-Arya@users.noreply.github.com> Date: Sun, 8 Mar 2026 23:32:52 -0400 Subject: [PATCH] Add type hints for bogo_sort.py (#14306) * Added type hints for bogo_sort * Update bogo_sort.py --------- Co-authored-by: Maxim Smolskiy --- sorts/bogo_sort.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sorts/bogo_sort.py b/sorts/bogo_sort.py index 9c133f0d8..70785140e 100644 --- a/sorts/bogo_sort.py +++ b/sorts/bogo_sort.py @@ -16,7 +16,7 @@ python bogo_sort.py import random -def bogo_sort(collection): +def bogo_sort(collection: list) -> list: """Pure implementation of the bogosort algorithm in Python :param collection: some mutable ordered collection with heterogeneous comparable items inside @@ -30,7 +30,7 @@ def bogo_sort(collection): [-45, -5, -2] """ - def is_sorted(collection): + def is_sorted(collection: list) -> bool: for i in range(len(collection) - 1): if collection[i] > collection[i + 1]: return False