Google Interview Question

Due to NDA, I cannot mention it, however, Leetcode helps.