Google interview question

Leetcode medium about arrays and lists