A set S of closed intervals whose end points are integers is given. Find the length of the smallest enclosing interval that contains all
the given intervals. For example, if the set of given intervals is S ={[1,3],[6,7],[2,4]}, then the length of the smallest enclosing
interval is 6.