Lukas Jiriste [Sat, 24 Feb 2024 10:18:02 +0000 (11:18 +0100)]
Fix "off by one" errors, fix find_target_ind
The function find_target_ind used (malfunctioning) binary search,
but that proved to be more difficult so I reimplemented it using
basic linear search.
Lukas Jiriste [Fri, 23 Feb 2024 09:36:57 +0000 (10:36 +0100)]
Implement a sorting algorithm
The idea is to push everything except for 3 elements from a to b.
Stack a can then be trivially sorted after which we can insert
(the cheapest) elements from b to the correct place in a.
The implementation needs to be refined as it does not actually sort.