Načítání úlohy…
This unusual sort does not move elements around; it removes anything that breaks the order. Walk through sequence from left to right and keep a number only if it is not smaller than every number already kept. Return the non-decreasing list of surviving elements.
[4, 3, 5, 2, 1, 7][4, 5, 7][1, 2, 3, 4][1, 2, 3, 4][4, 5, 5, 2, 3][4, 5, 5]def stalin_sort(sequence: list[int]) -> list[int]:
Přihlaste se, abyste viděli historii odevzdání
Přihlásit sePřihlaste se, abyste mohli použít AI mentora
Přihlásit seThey run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.