LeetCode solutions written in Java.
持续更新中...
参考 Blankj/awesome-java-leetcode,源代码都在 src 目录中,相关解题思路和分析都在 note 目录中。
以下是 LeetCode 官方精选的经典面试问题列表: Top Interview Questions Easy Collection
Array
# | Title |
---|---|
26 | Remove Duplicates from Sorted Array |
122 | Best Time to Buy and Sell Stock II |
189 | Rotate Array |
217 | Contains Duplicate |
136 | Single Number |
350 | Intersection of Two Arrays II |
66 | Plus One |
283 | Move Zeroes |
1 | Two Sum |
36 | Valid Sudoku |
48 | Rotate Image |
Strings
# | Title |
---|---|
344 | Reverse String |
7 | Reverse Integer |
387 | First Unique Character in a String |
242 | Valid Anagram |
125 | Valid Palindrome |
8 | String to Integer (atoi) |
28 | Implement strStr() |
38 | count-and-say |
14 | Longest Common Prefix |
Linked List
# | Title |
---|---|
237 | Delete Node in a Linked List |
19 | Remove Nth Node From End of List |
206 | Reverse Linked List |
21 | Merge Two Sorted Lists |
234 | Palindrome Linked List |
141 | Linked List Cycle |
Trees
# | Title |
---|---|
104 | Maximum Depth of Binary Tree |
98 | Validate Binary Search Tree |
其他
# | Title |
---|---|
121 | Best Time to Buy and Sell Stock |