complete almost_sorted_interval.py