![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
好题
zyp7355
这个作者很懒,什么都没留下…
展开
-
leetcode#86. Partition List
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the nodes in each of th...原创 2020-02-21 04:58:34 · 55 阅读 · 0 评论 -
leetcode# 82. Remove Duplicates from Sorted List II
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Example 1: Input: 1->2->3->3->4->4->5 Output: 1->2-...原创 2020-02-20 13:48:53 · 105 阅读 · 0 评论 -
leetcode#80. Remove Duplicates from Sorted Array II
Given a sorted array nums, remove the duplicates in-place such that duplicates appeared at most twice and return the new length. Do not allocate extra space for another array, you must do this by modi...原创 2020-02-20 04:07:27 · 55 阅读 · 0 评论 -
leetcode #61 rotate list
Given a linked list, rotate the list to the right by k places, where k is non-negative. Example 1: Input: 1->2->3->4->5->NULL, k = 2 Output: 4->5->1->2->3->NULL Explanati...原创 2020-02-14 14:32:23 · 59 阅读 · 0 评论 -
leetcode#59 Spiral Matrix II
Given a positive integer n, generate a square matrix filled with elements from 1 to n2 in spiral order. Example: Input: 3 Output: [ [ 1, 2, 3 ], [ 8, 9, 4 ], [ 7, 6, 5 ] ] 思路 根据第54题的思路这道题也变得相对简单 唯一需要修...原创 2020-02-12 12:07:35 · 73 阅读 · 0 评论 -
leetcode#54 spiral matrix
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order. Example 1: Input: [ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ] ] Output: [1,2,3,6,9,8,7,4,5] Example...原创 2020-02-12 04:40:37 · 67 阅读 · 0 评论 -
leetcode #18. 4Sum
Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of tar...原创 2020-02-05 14:10:48 · 70 阅读 · 0 评论 -
leetcode#17. Letter Combinations of a Phone Number(dfs最优解)
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) is give...原创 2020-02-05 08:44:59 · 65 阅读 · 0 评论