Open ghostjzf opened 3 years ago
function reverseList(head) { let prev = null; let curr = head; while(curr) { const cNext = curr.next; curr.next = prev; prev = curr; curr = cNext; } return prev; }