updating code for shortest-subsegment
Rank: 596. Score: 360/400