Cisco Interview Question

Coding Question was based on shortest distance between the points which can be coded in any of the programming languages.