3 ms·
Except that sorts the list in reverse: https://tio.run/##Vc6xDsIwDATQPV9xYyJ5od2Qyo9UGYhIwFXkVlY68PUhKSDEctb5Lbc9y2OVsdZbTAh7CDlacWcDpFXBYIFe5R5tjtLgkLctP2P6U4A
by btdmaster 3y ago
Except that sorts the list in reverse: https://tio.run/##Vc6xDsIwDATQPV9xYyJ5od2Qyo9UGYhIwFXkVlY68PUhKSDEctb5Lbc9y2OVsdZbTAh7CDlacWcDpFXBYIFe5R5tjtLgkLctP2P6U4ATZF48Lu2w/35xNOoy9aBem2ksuwrE5Gk@0UAjDd5sylLsZ1F2rtYX https://tio.run/##Vc6xDsIwDATQPV9xYyJ5od2Qyo9UGYhIwFXkVlY68P...
(Also a subtle off-by-one error, it should be 0 to |n|-1 and i to |n|-1.)
- cdelsolar 3y agoThanks for catching the reverse. I was aware of the off by one but thought the “to” operator I invented would be exclusive of the second operand (kinda like range in Python) :)