Just my luck, this was found immediately in the CI, right when I
uploaded the project thinking I was done.
Thankfully the fix is easy and (in hindsight) quite obvious.
From what I could find, the rules of the assignment seem to be:
1. Restrict oneself to at most *one* O(log(N)) call, and otherwise use
constant time operations on the map.
2. Don't use more operations than strictly necessary on `K` and `V`.
3. Prefer simplicity to performance.
I think my solution would fare well under those constraints.
This was especially helpful for my previous attempt at a solution, which
did was more complicated.
The original rules for this assignment are quite silly, I don't think
they really optimize anything, and make understanding the actual
algorithm more difficult than it should be.
This removes most of the redundant `for` loops that would appear in
hand-written unit tests, and could potentially open the door to
fuzz-testing/property-test the implementation for a more in-depth
test-suite.
Add `KeyInterface` (respectively `ValueInterface`). Those classes
provide the minimum documented interface for `K` (respectively `V`) in
`interval_map<K, V>`.