I have a question about dead case filling part of calculate_cases function.
Since the result array is not sorted, if we fill in the dead cases by increasing last_value (not max value) by 1,
There is a possibility of collision with non dead case hashes.
Wouldn't it?