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 0324e60 commit 81fcb90Copy full SHA for 81fcb90
sorts/bogo_sort.py
@@ -16,7 +16,7 @@
16
import random
17
18
19
-def bogo_sort(collection):
+def bogo_sort(collection: list) -> list:
20
"""Pure implementation of the bogosort algorithm in Python
21
:param collection: some mutable ordered collection with heterogeneous
22
comparable items inside
@@ -30,7 +30,7 @@ def bogo_sort(collection):
30
[-45, -5, -2]
31
"""
32
33
- def is_sorted(collection):
+ def is_sorted(collection: list) -> bool:
34
for i in range(len(collection) - 1):
35
if collection[i] > collection[i + 1]:
36
return False
0 commit comments