Pregunta de entrevista de Chatham Financial

Medium leetcode problem in coding assessments.