Google interview question

Leetcode medium difficulty level problems