Better HN
topnewbestaskshowjobs
Log inSign up

zxz910

1 karma · joined Sep 4, 2024 (2y ago) · 1 submissions

Submissions

comment 2y ago · link · parent

A variant of bubble sort I think would work. Taking into consideration the 'rotating index', each operation would correctly order three cards within the rotating index.

In each N pass, we should see each element at least 3 times, and it must advance toward it's desired position at least once. since it can't be at the 'wrong' end of the triple multiple times.

Worst case in N^2 ops we should be done.