Google interview question

some leet code questions were asked