Google interview question

lc easy level data structure