Another approach to Shortest Sub-Segment