LeetCode | 刷题日志
-
237. Delete Node in a Linked List
Write a function to delete a node (except the tail) in a singly linked list, given only access to th…
-
LeetCode – 86. Partition List
Given a linked list and a value x, partition it such that all nodes less than x come before nodes gr…
-
LeetCode – 203. Remove Linked List Elements
Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 –> …
-
LeetCode – 82. Remove Duplicates from Sorted List II
Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numb…
-
LeetCode – 83. Remove Duplicates from Sorted List
Given a sorted linked list, delete all duplicates such that each element appear only once. For examp…
-
LeetCode – 48. Rotate Image
You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). …
-
LeetCode – 581. Shortest Unsorted Continuous Subarray
Given an integer array, you need to find one continuous subarray that if you only sort this subarray…
-
LeetCode – 119. Pascal’s Triangle II
Given an index k, return the kth row of the Pascal’s triangle. For example, given k = 3,Return…
-
LeetCode – 118. Pascal’s Triangle
Given numRows, generate the first numRows of Pascal’s triangle. For example, given numRows = 5…
-
LeetCode – 243. Shortest Word Distance
Given a list of words and two words word1 and word2, return the shortest distance between these two …
-
LeetCode – 520. Detect Capital
Given a word, you need to judge whether the usage of capitals in it is right or not. We define the u…
-
LeetCode – 28. Implement strStr()
Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle…
-
LeetCode – 605. Can Place Flowers
Suppose you have a long flowerbed in which some of the plots are planted and some are not. However, …
-
LeetCode – 624. Maximum Distance in Arrays
Given m arrays, and each array is sorted in ascending order. Now you can pick up two integers from t…
-
643. Maximum Average Subarray I
Given an array consisting of n integers, find the contiguous subarray of given length k that has the…