NVIDIA interview question

Practical Python function question, not really leetcode.