Thank you for the response--I do have a follow up questions. But in the second scenario, we're setting the temp pointer to the exact same memory location as ptr->next. So why does it matter which one we delete? Aren't we effectively deleting the same node in either case?
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.