Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

134
Visualizações
Difference between VSCode IDE and Leetcode editor

Why is it that certain expressions in VScode result in different outputs than in Leetcode's built in editor? I was working through a "Reverse Linked List" question when I noticed that a solution accepted by Leetcode does not reverse the linked list if you copy/paste the solution in VScode

Question: https://leetcode.com/problems/reverse-linked-list/

const reverseList = (head) => {
  let prev = null;
  let curr = head;
  console.log(head.next); 
  // DIFFERENCE: (with the line above)
  // equals the "head" array with the first value removed in LC editor 
  // equals null in VScode
  while (curr) {
    const next = curr.next;
    curr.next = prev;
    prev = curr;
    curr = next;
  }
  return prev;
};
console.log(reverseList([1, 2, 3, 4, 5]));

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda