class Solution {
public:
void deleteNode(ListNode* node) {
while(node->next!=NULL){
node->val=node->next->val;
if(node->next->next==NULL){
node->next=NULL;
}
else{
node=node->next;
}
}
}
};
LeetCode - 237 Delete Node in a Linked List
最新推荐文章于 2022-10-13 10:32:50 发布