Pregunta de entrevista de Shift Technology

2 Coding Data Structure Questions, on Leetcode, easy level