Pregunta de entrevista de Samsung Research America

Coding: Array problem to find max distance amongst elements based on some criteria