(collection: list)
| 31 | """ |
| 32 | |
| 33 | def is_sorted(collection: list) -> bool: |
| 34 | for i in range(len(collection) - 1): |
| 35 | if collection[i] > collection[i + 1]: |
| 36 | return False |
| 37 | return True |
| 38 | |
| 39 | while not is_sorted(collection): |
| 40 | random.shuffle(collection) |