Pregunta de entrevista de Meta

Calculate shorter distance based on 2 points based on mathematical formula.