Skip to content

Commit 072f325

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 58d61ad commit 072f325

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sorts/flashsort.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import random
22
from typing import List
33

4+
45
def bogo_sort(collection: List[int]) -> List[int]:
56
"""Pure implementation of the bogosort algorithm in Python.
67
Bogosort generates random permutations until it guesses the correct one.
7-
8+
89
More info on: https://en.wikipedia.org/wiki/Bogosort
910
Args:
1011
collection (List[int]): A mutable ordered collection with comparable items.
@@ -25,7 +26,7 @@ def bogo_sort(collection: List[int]) -> List[int]:
2526
python -m doctest -v bogo_sort.py
2627
or
2728
python3 -m doctest -v bogo_sort.py
28-
29+
2930
For manual testing, run:
3031
python bogo_sort.py
3132
"""
@@ -40,6 +41,7 @@ def is_sorted(collection: List[int]) -> bool:
4041
random.shuffle(collection)
4142
return collection
4243

44+
4345
if __name__ == "__main__":
4446
user_input = input("Enter numbers separated by a comma:\n").strip()
4547
unsorted = [int(item) for item in user_input.split(",")]

0 commit comments

Comments
 (0)