Google interview question

OA, two questions, i would say leetcode medium