Pregunta de entrevista de Trimble

They asked me to solve a complex problem in Java to solve