blob: 86d10de03822ca1dafe5374c4e788082aab7d350 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
import numpy as np
def check_order(lst):
return [c for c, (a, b) in enumerate(zip(lst, sorted(lst))) if a != b]
# NumPy Solution
def check_order_np(lst):
l = np.array(lst)
return np.where(l != sorted(l))[0]
|