237. Delete Node in a Linked List - Day 13/31 Leetcode October Challenge

preview_player
Показать описание
Larry solves and analyzes this Leetcode problem as both an interviewer and an interviewee. This is a live recording of a real engineer solving a problem live - no cuts or edits!

#leetcode #coding #programming
Рекомендации по теме
Комментарии
Автор

Were you able to understand the problem? Edit: apparently there's an O(1) solution? Did you get that one?

Algorithmist
Автор

node.val = node.next.val
node.next = node.next.next
No need for error checking like Larry did since the question guarantees that the node removed won't be the tail of the list.

SmoothCode