Pergunta de entrevista da empresa NVIDIA

Practical Python function question, not really leetcode.