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