Skip to content
leetcode上的算法题Java解析
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/com/leetcode
.gitignore
LICENSE
README.md

README.md

LeetCode 算法题目

src目录结构说明

  1. extend:扩展包,题目中需要的一些扩展类,例如链表题目的节点类等。
  2. mains:Main 方法测试类,所有题目的测试入口类。可以直接运行。(从28题之后所有的测试代码都在submissions下)
  3. problems:题目说明类,包含解题的一些思路和需要注意的一些测试数据。(78题之后的思路都写在了代码里)
  4. submissions:提交的代码,解题的具体实现在这个包下。
  5. utils:工具类,一些测试用到的工具类,例如打印数组等。
  6. test:用于测试一些API。

题目目录

# 思路 代码 难度
94 Binary Tree Inorder Traversal Java Medium
93 Restore IP Addresses Java Medium
92 Reverse Linked List II Java Medium
91 Decode Ways Java Medium
90 Subsets II Java Medium
89 Gray Code Java Medium
88 Merge Sorted Array Java Easy
87 Scramble String Java Hard
86 Partition List Java Medium
85 Maximal Rectangle Java Hard
84 Largest Rectangle in Histogram Java Hard
83 Remove Duplicates from Sorted List Java Easy
82 Remove Duplicates from Sorted List II Java Medium
81 Search in Rotated Sorted Array II Java Medium
80 Remove Duplicates from Sorted Array II Java Medium
79 Word Search Java Medium
78 Subsets Java Medium
77 Combinations Java Medium
76 Minimum Window Substring Java Hard
75 Sort Colors Java Medium
74 Search a 2D Matrix Java Medium
73 Set Matrix Zeroes Java Medium
72 Edit Distance Java MinimumWindow
71 Simplify Path Java Medium
70 Climbing Stairs Java Easy
69 Sqrt(x) Java 自带的函数库。不过效率高 Easy
68 Text Justification Java Hard
67 Add Binary Java Hard
66 Plus One Java Easy
65 Valid Number Java Hard
64 Minimum Path Sum Java Medium
63 Unique Paths II Java Medium
62 Unique Paths Java Medium
61 Rotate List Java Medium
60 Permutation Sequence Java Medium
59 Spiral Matrix II Java Medium
58 Length of Last Word Java Easy
57 Insert Interval Java Hard
56 Merge Intervals Java Medium
55 Jump Game Java Medium
54 Spiral Matrix Java Medium
53 Maximum Subarray Java Medium
52 N-Queens II Java Hard
51 N-Queens Java Hard
50 Pow(x, n) Java Medium
49 Group Anagrams Java Medium
48 Rotate Image Java Medium
47 PermutationsII Java Medium
46 Permutations Java Medium
45 JumpGame Java Hard
44 WildcardMatching Java Hard
43 Multiply strings Java Medium
42 Trapping Rain Water Java Hard
41 First missing positive Java Hard
40 Combination Sum II Java Medium
39 Combination Sum Java Medium
38 Count and Say Java Easy
37 Sudoku Solver Java Hard
36 Valid Sudoku Java Medium
35 Search Insert Position Java Easy
34 Search for a Range Java Medium
33 Search in Rotated Sorted Array Java Medium
32 Longest Valid Parentheses Java Hard
31 Next Permutation Java Medium
30 Substring with Concatenation of All Words Java Hard
29 Divide Two Integers Java Medium
28 Implement strStr() Java Easy
27 Remove Element Java Easy
26 Remove Duplicates from Sorted Array Java Easy
25 Reverse Nodes in k-Group Java Hard
24 Swap Nodes in Pairs Java Medium
23 Merge k Sorted Lists Java Hard
22 Generate Parentheses Java Medium
21 Merge Two Sorted Lists Java Easy
20 Valid Parentheses Java Easy
19 Remove Nth Node From End of List Java Medium
18 4Sum Java Medium
17 Letter Combinations of a Phone Number Java Medium
16 3Sum Closest Java Medium
15 3Sum Java Medium
14 Longest Common Prefix Java Easy
13 Roman to Integer Java Easy
12 Integer to Roman Java Medium
11 Container With Most Water Java Medium
10 Regular Expression Matching Java Hard
9 Palindrome Number Java Easy
8 String to Integer (atoi) Java Medium
7 Reverse Integer Java Easy
6 ZigZag Conversion Java Medium
5 Longest palindromic substring Java Medium
4 Median of Two Sorted Arrays Java Hard
3 Longest Substring Without Repeating Characters Java Medium
2 Add Two Numbers Java Medium
1 Two sum Java Easy
You can’t perform that action at this time.