Update quantum_bogo_sort.py line too long error resolved

This commit is contained in:
Silicon27 2024-10-13 12:50:37 +02:00 committed by GitHub
parent 4a9404f6f0
commit 1aac36937e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,13 +1,15 @@
def quantum_bogo_sort(arr: list[int]) -> list[int]: def quantum_bogo_sort(arr: list[int]) -> list[int]:
""" """
Quantum Bogo Sort is a theoretical sorting algorithm that uses quantum mechanics to sort the elements. Quantum Bogo Sort is a theoretical sorting algorithm that uses quantum
It is not practically feasible and is included here for humor. mechanics to sort the elements. It is not practically feasible and is
included here for humor.
Reference: More info:
https://en.wikipedia.org/wiki/Bogosort#:~:text=achieve%20massive%20complexity.-,Quantum%20bogosort,-A%20hypothetical%20sorting https://en.wikipedia.org/wiki/Bogosort#:~:text=achieve%20massive%20complexity.-,Quantum%20bogosort,-A%20hypothetical%20sorting
:param arr: list[int] - The list of numbers to sort. :param arr: list[int] - The list of numbers to sort.
:return: list[int] - The sorted list, humorously assumed to be instantly sorted using quantum superposition. :return: list[int] - The sorted list, humorously assumed to be
instantly sorted using quantum superposition.
Example: Example:
>>> quantum_bogo_sort([2, 1, 4, 3]) >>> quantum_bogo_sort([2, 1, 4, 3])
@ -22,9 +24,7 @@ def quantum_bogo_sort(arr: list[int]) -> list[int]:
>>> quantum_bogo_sort([]) >>> quantum_bogo_sort([])
[] []
""" """
return sorted( return sorted(arr) # Sorting is assumed to be done instantly via quantum superposition
arr
) # Sorting is assumed to be done instantly via quantum superposition
if __name__ == "__main__": if __name__ == "__main__":