Pergunta de entrevista da empresa Amazon

Two LP, one very easy list-like coding problem.