摘要: Leetcode每日一题-61.旋转链表 题解看代码注释 方式一 不借助额外空间,对k取模,移动有限次 核心在于首尾相连+断链 代码 func rotateRight(head *ListNode, k int) *ListNode { if head == nil { return head } 阅读全文
posted @ 2021-03-27 09:30 blog_zhangtong 阅读(49) 评论(0) 推荐(0)