We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
原题链接
1.将 curr 指针指向链表头节点 2.遍历链表,注意边界条件 3.如果当前节点与它后面的节点值相等,则删除它后面与它重复的节点 4.不重复则继续遍历,最后返回头节点
const deleteDuplicates = function(head) { let curr = head while (curr !== null && curr.next !== null) { if (curr.val === curr.next.val) { curr.next = curr.next.next } else { curr = curr.next } } return head }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
原题链接
1.将 curr 指针指向链表头节点
2.遍历链表,注意边界条件
3.如果当前节点与它后面的节点值相等,则删除它后面与它重复的节点
4.不重复则继续遍历,最后返回头节点
The text was updated successfully, but these errors were encountered: