Pregunta de entrevista de NVIDIA

it was a leetcode easy