Pregunta de entrevista de Qualcomm

leetcode question from blind 75