Tesla Interview Question

Data structures. (VERY) Easy leetcode