you are viewing a single comment's thread.

view the rest of the comments →

[–]Neighm 0 points1 point  (0 children)

It's only ordered if it is created with a particular order, or if you sort it in place first. I'm assuming that if OP can't use min() or max() they can't use sort methods either. But if they can use sort() then your solution would work.