Pregunta de entrevista de Google

Simple DSA question, which could be seen from leetcode