Update bogo_sort.py (#8144)

This commit is contained in:
Jan Wojciechowski 2023-02-19 23:14:01 +01:00 committed by GitHub
parent 126e89d8a3
commit 1bf03889c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,8 +31,6 @@ def bogo_sort(collection):
"""
def is_sorted(collection):
if len(collection) < 2:
return True
for i in range(len(collection) - 1):
if collection[i] > collection[i + 1]:
return False