Google interview question

they all are on leetcode