NVIDIA Interview Question

One logical question and one leetcode style quesiton