网站首页 站内搜索

搜索结果

查询Tags标签: No.19,共有 1条记录
  • 腾讯五十题 No.19旋转链表

    题目链接 class Solution {public ListNode rotateRight(ListNode head, int k) {if(head == null) return null;int len = 1;ListNode tail = head;while(tail.next != null){len++;tail = tail.next;}//此刻tail已经是尾节点了// 3 - 4%3 = 2k = len-k%len;if(k==0) ret…

    2022/2/7 6:13:57 人评论 次浏览
扫一扫关注最新编程教程