News for hackers. Stuff that matters.
Re:Pythonic monotonic by benburk on Friday August 13, 2021 @12:01PM (#28170657)
Fails for

  [1, 1, 2, 3, 3, 2, 1, 1] -> [[1, 1, 2, 3, 3], [1, 2], [1, 2], [1]]
Re:Pythonic monotonic by alecst on Friday August 13, 2021 @12:24PM (#28170981)
Thanks. I was inconsistent in my use of >= and >. Making them consistent has fixed this edge case.
Re:Pythonic monotonic by benburk on Friday August 13, 2021 @12:55PM (#28171451)
Also fails for

  [3, 3, 2, 2, 1, 1] -> [[3, 3], [2, 2], [1, 1]]
Here's my solution https://news.ycombinator.com/item?id=28170735
Re:Pythonic monotonic by eesmith on Friday August 13, 2021 @01:18PM (#28171729)
And for [1]; the "return sorted(arr)" needs to be "return [sorted(arr)]".