Pregunta de entrevista de Broadcom

leetcode and the horse race problem