摘要: Given an array, rotate the array to the right by k steps, where k is non-negative. Follow up: Try to come up as many solutions as you can, there are a 阅读全文
posted @ 2019-11-05 15:46 CNoodle 阅读(172) 评论(0) 推荐(0) 编辑
摘要: Given the head of a linked list, rotate the list to the right by k places. Example 1: Input: head = [1,2,3,4,5], k = 2 Output: [4,5,1,2,3] Example 2: 阅读全文
posted @ 2019-11-05 15:25 CNoodle 阅读(426) 评论(0) 推荐(0) 编辑
摘要: Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordere 阅读全文
posted @ 2019-11-05 03:34 CNoodle 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Write an efficient algorithm that searches for a target value in an m x n integer matrix. The matrix has the following properties: Integers in each ro 阅读全文
posted @ 2019-11-05 02:23 CNoodle 阅读(185) 评论(0) 推荐(0) 编辑
摘要: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted f 阅读全文
posted @ 2019-11-05 02:08 CNoodle 阅读(454) 评论(0) 推荐(0) 编辑
摘要: There is an integer array nums sorted in non-decreasing order (not necessarily with distinct values). Before being passed to your function, nums is ro 阅读全文
posted @ 2019-11-05 00:03 CNoodle 阅读(423) 评论(0) 推荐(0) 编辑