Pregunta de entrevista de Bentley Systems

Write an algorithm in psuedocode