Method returns minimum distance to travel to cover all intervals
static int minDistanceToCoverIntervals ( Interval [ ] intervals , int N , int x ) { int rightMostStart = int . MinValue ; int leftMostEnd = int . MaxValue ;