Google interview question

Leetcode questions