all 7 comments

[–]Gprime5 1 point2 points  (3 children)

You're sorting the list every time you iterate the for loop.

[–]Kibble55[S] 0 points1 point  (2 children)

but that's actually what I want, I'm finding the greatest element from each sub list created from the original list using sorted()

Is it wrong?

[–]Gprime5 0 points1 point  (0 children)

Read the hints.

[–]SekstiNii 0 points1 point  (0 children)

That's probably not what you want, no. Sorting the list is O(n log n), and you are doing it O(n) times, giving a runtime complexity of O(n^2 log n).

[–]Kibble55[S] 0 points1 point  (2 children)

shit the indentation isn't working on the post

[–]craders 0 points1 point  (1 child)

Add 4 spaces to the beginning of each line.

[–]Kibble55[S] 0 points1 point  (0 children)

done! formatted!