NVIDIA Interview Question

it was a leetcode easy