Sollicitatievraag bij Google

Simple DSA question, which could be seen from leetcode