Pergunta de entrevista da empresa Microsoft

Data structures related 2 questions not able to solve