0
点赞
收藏
分享

微信扫一扫

每日一练lc(24)

醉东枫 2022-01-22 阅读 17
class Solution {
    public ListNode swapPairs(ListNode head) {
if(head==null || head.next==null){
    return head;
}
ListNode next=head.next;
head.next=swapPairs(head.next.next);
next.next=head;
return next;
    }
}

在这里插入图片描述

举报

相关推荐

0 条评论