Exponential AI interview question

They asked an easy-level LeetCode question based on lists.