Reverse Linked List

Implemente reverseList(head) que recebe uma lista ligada com nós { val, next } e retorna o novo head invertido. Se head for null/undefined, retorne null.

Pendente

Seu código

Dica: implemente exatamente a função reverseList.

Resultado

Clique em Executar para rodar os testes.