Compute point-to-segment minimum distance | LinkedIn Interview Question