Vyxal, 15 13 1010 9 bytes
t≥AǔḢ)↔Ṫvg(:g…Ȯt=ǔḢ
It's not every day I get to use recursion in a lambda Nevermind, I don't anymore.
-3 thanks to AndrovT
-1 by outputting items on newlines
Explained
t≥AǔḢ)↔Ṫvg(:g…Ȯt=ǔḢ
( )↔ # repeat the following, starting with the# input, until the result doesn't change, collecting intermittentlength valuestimes:
t≥ :g… # is get the tailminimum of the list greatertop thanof orthe equalstack towithout eachpopping itemand inprint thethat list?without Vectorises.popping
A Ȯt # is that true for all items?push Returnsthe 1tail ifof itthe isitem (implyingover the tailtop isof the minimumstack
- it's less than or equal= to everything) or 0# otherwise. Big braindoes ideathat courtesyequal ofthe Androvmin?
ǔ ǔ # rotate the list right that many times (once if tail is min [placing tail at front] or no times at all).
Ḣ Ḣ # Remove the head of the list
Ṫ # discard the empty list at the end
vg # and get the minimum of each list in the fixed point result