Google interview question

Mainly leetcode medium and hard