Erratum: this solution doesn't properly deal with the rule that edges can be modified by up 0.001. The problem actually turns out to be much harder than we realized at the time, and we're not sure if it has a good solution! This solution solves all the test cases, however, which were not subtle enough to test this edge case.
Published 2016-08-03 · Watch on YouTube ↗ Availability and playback restrictions are controlled by the original channel.