Code for problem "Insert Interval".