NVIDIA Interview Question

Practical Python function question, not really leetcode.