Pergunta de entrevista da empresa Meta

An algorithms question involving recursion on lists.