NVIDIA interview question

Leetcode mediums, variation to hard