Python - Sort Matrix by Number of elements greater than its previous element
Given a Matrix, sort by occurrences where next element is greater than current. Compute the count of i < i + 1 in each list, sort each row by count of each of this condition in each row. Input : test_list = [[4, 6, 2, 9, 10], [5, 3, 2, 5], [2, 4, 5, 6, 7, 7], [6, 3, 2]] Output : [[6, 3, 2], [5, 3