Pregunta de entrevista de Windsurf

Asked one leetcode hard problem for OA