You, leetcode

57. Insert Interval

The finished form of the program isn't too bad, but it was really ugly for about an hour until I figured out what I wanted to do.

Something new I'm trying is to comment what invariants I can count on at various points in the code. It has helped me keep my thinking straight.

The code listing and forum post are here: