Shortest Segment

Rules

Draw a single continuous loop in the grid using horizontal and vertical line segments so that the loop visits every cell exactly once. It should not cross or overlap itself. Clues outside indicate the lengths of the shortest segment in that direction.

Click to see the answer.