Skip to content

the practice of algorithm in LeetCode. 400 questions has been resolved

Notifications You must be signed in to change notification settings

whitefly/Java-Leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Java的刷题本

题库:LeetCode 已刷:357

题号 Title java 类别
1 two sum 答案链接 哈希
2 add two numbers 答案链接 链表
3 longest substring without repeating characters 答案链接 滑动窗口
4 median of two sorted arrays 答案链接 二分
5 longest palindromic substring 答案链接 KMP
6 zigzag conversion 答案链接 排版题
7 reverse integer 答案链接 字符串
8 string to integer atoi 答案链接 有限状态机
9 palindrome number 答案链接 字符串
11 container with most water 答案链接 双指针
12 integer to roman 答案链接 字符串
13 roman to integer 答案链接 字符串
14 longest common prefix 答案链接 字符串
15 3sum 答案链接 双指针
16 3sum closest 答案链接 双指针
17 letter combinations of a phone number 答案链接 递归
19 remove nth node from end of list 答案链接 双指针
20 valid parentheses 答案链接
21 merge two sorted lists 答案链接 链表
22 generate parentheses 答案链接 回溯剪枝
23 merge k sorted lists 答案链接
24 swap nodes in pairs 答案链接 链表
25 reverse nodes in k group 答案链接 链表
26 remove duplicates from sorted array 答案链接 重复元素
27 remove element 答案链接 重复元素
28 implement strstr 答案链接 字符串
29 divide two integers 答案链接 二分
31 next permutation 答案链接 排列组合
33 search in rotated sorted array 答案链接 二分
34 find first and last position of element in sorted array 答案链接 二分
35 search insert position 答案链接 二分
36 valid sudoku 答案链接 哈希
37 sudoku solver 答案链接 回溯剪枝
38 count and say 答案链接 哈希
39 combination sum 答案链接 排列组合
40 combination sum ii 答案链接 排列组合
41 first missing positive 答案链接 有限范围数组
42 trapping rain water 答案链接 动态规划
43 multiply strings 答案链接 大数
45 jump game ii 答案链接 动态规划
46 permutations 答案链接 排列组合
47 permutations ii 答案链接 排列组合
48 rotate image 答案链接 图形学
49 group anagrams 答案链接 哈希
50 powx n 答案链接 二分
53 maximum subarray 答案链接 动态规划
54 spiral matrix 答案链接 排版题
55 jump game 答案链接 动态规划
56 merge intervals 答案链接 区间问题
57 insert interval 答案链接 图形学
58 length of last word 答案链接 字符串
59 spiral matrix ii 答案链接 排版题
60 permutation sequence 答案链接 排列组合
61 rotate list 答案链接 链表
62 unique paths 答案链接 动态规划
63 unique paths ii 答案链接 动态规划
64 minimum path sum 答案链接 动态规划
66 plus one 答案链接 大数
67 add binary 答案链接 大数
69 sqrtx 答案链接 二分
70 climbing stairs 答案链接 动态规划
71 simplify path 答案链接
72 edit distance 答案链接 字符串距离
73 set matrix zeroes 答案链接 图形学
74 search a 2d matrix 答案链接 二分
75 sort colors 答案链接 双指针
76 minimum window substring 答案链接 滑动窗口
77 combinations 答案链接 排列组合
78 subsets 答案链接 排列组合
79 word search 答案链接 回溯剪枝
80 remove duplicates from sorted array ii 答案链接 重复元素
81 search in rotated sorted array ii 答案链接 二分
82 remove duplicates from sorted list ii 答案链接 链表
83 remove duplicates from sorted list 答案链接 链表
84 largest rectangle in histogram 答案链接
85 maximal rectangle 答案链接 图形学
85 maximal rectangle 答案链接
86 partition list 答案链接 链表
88 merge sorted array 答案链接 排序
89 gray code 答案链接 位运算
90 subsets ii 答案链接 排列组合
91 decode ways 答案链接 动态规划
92 reverse linked list ii 答案链接 链表
93 restore ip addresses 答案链接 递归
95 unique binary search trees ii 答案链接 树递归
98 validate binary search tree 答案链接 树递归
100 same tree 答案链接 树递归
101 symmetric tree 答案链接 树递归
102 binary tree level order traversal 答案链接 树递归
103 binary tree zigzag level order traversal 答案链接 树递归
104 maximum depth of binary tree 答案链接 树递归
105 construct binary tree from preorder and inorder traversal 答案链接 树递归
106 construct binary tree from inorder and postorder traversal 答案链接 树递归
107 binary tree level order traversal ii 答案链接 树递归
108 convert sorted array to binary search tree 答案链接 树递归
109 convert sorted list to binary search tree 答案链接 树递归
110 balanced binary tree 答案链接 树递归
111 minimum depth of binary tree 答案链接 树递归
112 path sum 答案链接 树递归
113 path sum ii 答案链接 树递归
114 flatten binary tree to linked list 答案链接 树递归
116 populating next right pointers in each node 答案链接 树递归
117 populating next right pointers in each node ii 答案链接 树递归
118 pascals triangle 答案链接 排版题
119 pascals triangle ii 答案链接 动态规划
120 triangle 答案链接 动态规划
121 best time to buy and sell stock 答案链接 动态规划
122 best time to buy and sell stock ii 答案链接 动态规划
123 best time to buy and sell stock iii 答案链接 动态规划
124 binary tree maximum path sum 答案链接 树递归
125 valid palindrome 答案链接 双指针
127 valid palindrome 答案链接 字符串
127 word ladder 答案链接 图论
128 longest consecutive sequence 答案链接 哈希
129 sum root to leaf numbers 答案链接 树递归
130 surrounded regions 答案链接 图形学
131 palindrome partitioning 答案链接 递归
133 clone graph 答案链接 图论
134 gas station 答案链接 贪心
136 single number 答案链接 重复元素
137 single number ii 答案链接 位运算
138 copy list with random pointer 答案链接 哈希
139 word break 答案链接 动态规划
141 linked list cycle 答案链接 双指针
142 linked list cycle ii 答案链接 双指针
145 binary tree postorder traversal 答案链接 树递归
146 lru cache 答案链接 链表
147 insertion sort list 答案链接 链表
148 sort list 答案链接 排序
150 evaluate reverse polish notation 答案链接
153 find minimum in rotated sorted array 答案链接 二分
156 binary tree upside down 答案链接 树递归
157 read n characters given read4 答案链接 IO
161 one edit distance 答案链接 字符串距离
162 find peak element 答案链接 二分
164 maximum gap 答案链接 桶思想
165 compare version numbers 答案链接 字符串
169 majority element 答案链接 重复元素
174 dungeon game 答案链接 动态规划
187 repeated dna sequences 答案链接 压缩编码
188 best time to buy and sell stock iv 答案链接 动态规划
189 rotate array 答案链接 数学结论
190 reverse bits 答案链接 字符串
191 number of 1 bits 答案链接 位运算
198 house robber 答案链接 动态规划
199 binary tree right side view 答案链接 树递归
200 number of islands 答案链接 图论
201 bitwise and of numbers range 答案链接 位运算
203 remove linked list elements 答案链接 链表
206 reverse linked list 答案链接 链表
207 course schedule 答案链接 图论
208 implement trie prefix tree 答案链接 前缀树
209 minimum size subarray sum 答案链接 双指针
210 course schedule ii 答案链接 图论
211 add and search word data structure design 答案链接 前缀树
213 house robber ii 答案链接 动态规划
214 shortest palindrome 答案链接 KMP
215 kth largest element in an array 答案链接 排序
216 combination sum iii 答案链接 排列组合
217 contains duplicate 答案链接 哈希
220 contains duplicate iii 答案链接 哈希
221 maximal square 答案链接 动态规划
222 count complete tree nodes 答案链接 树递归
229 majority element ii 答案链接 重复元素
230 kth smallest element in a bst 答案链接 树递归
231 power of two 答案链接 位运算
234 palindrome linked list 答案链接 链表
235 lowest common ancestor of a binary search tree 答案链接 树递归
236 lowest common ancestor of a binary tree 答案链接 树递归
237 delete node in a linked list 答案链接 链表
238 product of array except self 答案链接 动态规划
239 sliding window maximum 答案链接 滑动窗口
242 valid anagram 答案链接 哈希
243 shortest word distance 答案链接 哈希
244 shortest word distance ii 答案链接 哈希
252 meeting rooms 答案链接 区间问题
253 meeting rooms ii 答案链接 区间问题
257 binary tree paths 答案链接 树递归
264 ugly number ii 答案链接 排列组合
268 missing number 答案链接 有限范围数组
273 integer to english words 答案链接 字符串
278 first bad version 答案链接 二分
279 perfect squares 答案链接 动态规划
284 peeking iterator 答案链接 迭代器
287 find the duplicate number 答案链接 重复元素
289 game of life 答案链接 图形学
299 bulls and cows 答案链接 哈希
300 longest increasing subsequence 答案链接 子序列
307 range sum query mutable 答案链接 线段树
309 best time to buy and sell stock with cooldown 答案链接 动态规划
310 minimum height trees 答案链接 图论
318 maximum product of word lengths 答案链接 哈希
322 coin change 答案链接 背包问题
327 count of range sum 答案链接 线段树
328 odd even linked list 答案链接 链表
329 longest increasing path in a matrix 答案链接 动态规划
331 verify preorder serialization of a binary tree 答案链接 树递归
337 house robber iii 答案链接 动态规划
338 counting bits 答案链接 位运算
341 flatten nested list iterator 答案链接 迭代器
342 power of four 答案链接 位运算
343 integer break 答案链接 动态规划
345 reverse vowels of a string 答案链接 双指针
347 top k frequent elements 答案链接
354 russian doll envelopes 答案链接 子序列
354 russian doll envelopes 答案链接 动态规划
357 count numbers with unique digits 答案链接 动态规划
365 water and jug problem 答案链接 回溯剪枝
368 largest divisible subset 答案链接 排列组合
371 sum of two integers 答案链接 位运算
373 find k pairs with smallest sums 答案链接
374 guess number higher or lower 答案链接 二分
376 wiggle subsequence 答案链接 动态规划
377 combination sum iv 答案链接 排列组合
378 kth smallest element in a sorted matrix 答案链接
382 linked list random node 答案链接 概率
383 ransom note 答案链接 字符串
384 shuffle an array 答案链接 概率
387 first unique character in a string 答案链接 哈希
392 is subsequence 答案链接 字符串
393 utf 8 validation 答案链接 位运算
394 decode string 答案链接
397 integer replacement 答案链接 位运算
398 random pick index 答案链接 概率
400 nth digit 答案链接 数学结论
401 binary watch 答案链接 排列组合
405 convert a number to hexadecimal 答案链接 位运算
406 queue reconstruction by height 答案链接 贪心
413 arithmetic slices 答案链接 动态规划
415 add strings 答案链接 字符串
416 partition equal subset sum 答案链接 背包问题
419 battleships in a board 答案链接 动态规划
424 longest repeating character replacement 答案链接 滑动窗口
429 n ary tree level order traversal 答案链接 树递归
430 flatten a multilevel doubly linked list 答案链接 链表
434 number of segments in a string 答案链接 字符串
435 non overlapping intervals 答案链接 区间问题
437 path sum iii 答案链接 树递归
438 find all anagrams in a string 答案链接 滑动窗口
443 string compression 答案链接 压缩编码
445 add two numbers ii 答案链接 链表
448 find all numbers disappeared in an array 答案链接 有限范围数组
450 delete node in a bst 答案链接 树递归
451 sort characters by frequency 答案链接 哈希
452 minimum number of arrows to burst balloons 答案链接 区间问题
455 assign cookies 答案链接 双指针
456 132 pattern 答案链接
459 repeated substring pattern 答案链接 KMP
467 unique substrings in wraparound string 答案链接 动态规划
468 validate ip address 答案链接 字符串
470 implement rand10 using rand7 答案链接 概率
474 ones and zeroes 答案链接 背包问题
477 total hamming distance 答案链接 位运算
478 generate random point in a circle 答案链接 概率
485 max consecutive ones 答案链接 动态规划
492 construct the rectangle 答案链接 数学结论
494 target sum 答案链接 回溯剪枝
496 next greater element i 答案链接
498 diagonal traverse 答案链接 排版题
501 find mode in binary search tree 答案链接 树递归
503 next greater element ii 答案链接
504 base 7 答案链接 数学结论
506 relative ranks 答案链接 哈希
508 most frequent subtree sum 答案链接 树递归
509 fibonacci number 答案链接 动态规划
513 find bottom left tree value 答案链接 树递归
514 freedom trail 答案链接 动态规划
515 find largest value in each tree row 答案链接 树递归
516 longest palindromic subsequence 答案链接 动态规划
518 coin change 2 答案链接 动态规划
523 continuous subarray sum 答案链接 哈希
524 longest word in dictionary through deleting 答案链接 字符串
525 contiguous array 答案链接 哈希
530 minimum absolute difference in bst 答案链接 树递归
538 convert bst to greater tree 答案链接 树递归
539 minimum time difference 答案链接 字符串
543 diameter of binary tree 答案链接 树递归
559 maximum depth of n ary tree 答案链接 树递归
560 subarray sum equals k 答案链接 子数组
563 binary tree tilt 答案链接 树递归
565 array nesting 答案链接 动态规划
567 permutation in string 答案链接 哈希
572 subtree of another tree 答案链接 树递归
576 out of boundary paths 答案链接 动态规划
583 delete operation for two strings 答案链接 动态规划
589 n ary tree preorder traversal 答案链接 树递归
590 n ary tree postorder traversal 答案链接 树递归
592 fraction addition and subtraction 答案链接 数学结论
606 construct string from binary tree 答案链接 树递归
621 task scheduler 答案链接 桶思想
623 add one row to tree 答案链接 树递归
637 average of levels in binary tree 答案链接 树递归
638 shopping offers 答案链接 背包问题
640 solve the equation 答案链接 字符串
646 maximum length of pair chain 答案链接 贪心
647 palindromic substrings 答案链接 动态规划
648 replace words 答案链接 前缀树
653 two sum iv input is a bst 答案链接 树递归
662 maximum width of binary tree 答案链接 树递归
669 trim a binary search tree 答案链接 树递归
671 second minimum node in a binary tree 答案链接 树递归
673 number of longest increasing subsequence 答案链接 子序列
677 map sum pairs 答案链接 前缀树
680 valid palindrome ii 答案链接 字符串
687 longest univalue path 答案链接 树递归
700 search in a binary search tree 答案链接 树递归
701 insert into a binary search tree 答案链接 树递归
703 kth largest element in a stream 答案链接
704 binary search 答案链接 二分
712 minimum ascii delete sum for two strings 答案链接 动态规划
713 subarray product less than k 答案链接 子数组
714 best time to buy and sell stock with transaction fee 答案链接 动态规划
718 maximum length of repeated subarray 答案链接 动态规划
725 split linked list in parts 答案链接 链表
729 my calendar i 答案链接 二分
739 daily temperatures 答案链接
746 min cost climbing stairs 答案链接 动态规划
748 shortest completing word 答案链接 哈希
765 couples holding hands 答案链接 有限范围数组
767 reorganize string 答案链接 排列组合
783 minimum distance between bst nodes 答案链接 树递归
784 letter case permutation 答案链接 排列组合
785 is graph bipartite 答案链接 二分图
792 number of matching subsequences 答案链接 子序列
795 number of subarrays with bounded maximum 答案链接 子数组
796 rotate string 答案链接 KMP
811 subdomain visit count 答案链接 哈希
842 split array into fibonacci sequence 答案链接 回溯剪枝
844 backspace string compare 答案链接
853 car fleet 答案链接 数学结论
856 score of parentheses 答案链接
875 koko eating bananas 答案链接 二分
887 super egg drop 答案链接 动态规划
894 all possible full binary trees 答案链接 树递归
901 online stock span 答案链接
905 sort array by parity 答案链接 排序
907 sum of subarray minimums 答案链接
921 minimum add to make parentheses valid 答案链接
922 sort array by parity ii 答案链接 双指针
938 range sum of bst 答案链接 树递归
941 valid mountain array 答案链接 双指针
946 validate stack sequences 答案链接 回溯剪枝
974 subarray sums divisible by k 答案链接 子数组
986 interval list intersections 答案链接 区间问题
1004 max consecutive ones iii 答案链接 滑动窗口
1019 next greater node in linked list 答案链接
1030 matrix cells in distance order 答案链接 图论
1114 print in order 答案链接 多线程
1115 print foobar alternately 答案链接 多线程
1116 print zero even odd 答案链接 多线程
1117 building h2o 答案链接 多线程
1155 number of dice rolls with target sum 答案链接 背包问题
1195 fizz buzz multithreaded 答案链接 多线程
1226 the dining philosophers 答案链接 多线程
1363 largest multiple of three 答案链接 整除问题
1551 minimum operations to make array equal 答案链接 数学结论
5089 meeting scheduler 答案链接 双指针

题库:剑指offer 已刷:54

题号 Title java 类别
11 xuan zhuan shu zu de zui xiao shu zi lcof 答案链接 剑指Offer
12 ju zhen zhong de lu jing lcof 答案链接 剑指Offer
15 er jin zhi zhong 1de ge shu lcof 答案链接 剑指Offer
16 shu zhi de zheng shu ci fang lcof 答案链接 剑指Offer
17 da yin cong 1dao zui da de nwei shu lcof 答案链接 剑指Offer
18 shan chu lian biao de jie dian lcof 答案链接 剑指Offer
21 diao zheng shu zu shun xu shi qi shu wei yu ou shu qian mian lcof 答案链接 剑指Offer
22 lian biao zhong dao shu di kge jie dian lcof 答案链接 剑指Offer
24 fan zhuan lian biao lcof 答案链接 剑指Offer
26 shu de zi jie gou lcof 答案链接 剑指Offer
27 er cha shu de jing xiang lcof 答案链接 剑指Offer
28 dui cheng de er cha shu lcof 答案链接 剑指Offer
29 shun shi zhen da yin ju zhen lcof 答案链接 剑指Offer
30 bao han minhan shu de zhan lcof 答案链接 剑指Offer
31 zhan de ya ru dan chu xu lie lcof 答案链接 剑指Offer
33 er cha sou suo shu de hou xu bian li xu lie lcof 答案链接 剑指Offer
34 er cha shu zhong he wei mou yi zhi de lu jing lcof 答案链接 剑指Offer
35 fu za lian biao de fu zhi lcof 答案链接 剑指Offer
37 xu lie hua er cha shu lcof 答案链接 剑指Offer
38 zi fu chuan de pai lie lcof 答案链接 剑指Offer
39 shu zu zhong chu xian ci shu chao guo yi ban de shu zi lcof 答案链接 剑指Offer
40 zui xiao de kge shu lcof 答案链接 剑指Offer
41 shu ju liu zhong de zhong wei shu lcof 答案链接 剑指Offer
42 lian xu zi shu zu de zui da he lcof 答案链接 剑指Offer
45 ba shu zu pai cheng zui xiao de shu lcof 答案链接 剑指Offer
46 ba shu zi fan yi cheng zi fu chuan lcof 答案链接 剑指Offer
47 li wu de zui da jie zhi lcof 答案链接 剑指Offer
48 zui chang bu han zhong fu zi fu de zi zi fu chuan lcof 答案链接 剑指Offer
50 di yi ge zhi chu xian yi ci de zi fu lcof 答案链接 剑指Offer
51 shu zu zhong de ni xu dui lcof 答案链接 剑指Offer
52 liang ge lian biao de di yi ge gong gong jie dian lcof 答案链接 剑指Offer
53 zai pai xu shu zu zhong cha zhao shu zi lcof 答案链接 剑指Offer
53 que shi de shu zi lcof 答案链接 剑指Offer
54 er cha sou suo shu de di kda jie dian lcof 答案链接 剑指Offer
55 er cha shu de shen du lcof 答案链接 剑指Offer
55 ping heng er cha shu lcof 答案链接 剑指Offer
56 shu zu zhong shu zi chu xian de ci shu ii lcof 答案链接 剑指Offer
56 shu zu zhong shu zi chu xian de ci shu lcof 答案链接 剑指Offer
57 he wei sde liang ge shu zi lcof 答案链接 剑指Offer
57 he wei sde lian xu zheng shu xu lie lcof 答案链接 剑指Offer
58 zuo xuan zhuan zi fu chuan lcof 答案链接 剑指Offer
58 fan zhuan dan ci shun xu lcof 答案链接 剑指Offer
59 hua dong chuang kou de zui da zhi lcof 答案链接 剑指Offer
59 dui lie de zui da zhi lcof 答案链接 剑指Offer
60 nge tou zi de dian shu lcof 答案链接 剑指Offer
61 bu ke pai zhong de shun zi lcof 答案链接 剑指Offer
62 yuan quan zhong zui hou sheng xia de shu zi lcof 答案链接 剑指Offer
63 gu piao de zui da li run lcof 答案链接 剑指Offer
64 qiu 12n lcof 答案链接 剑指Offer
65 bu yong jia jian cheng chu zuo jia fa lcof 答案链接 剑指Offer
66 gou jian cheng ji shu zu lcof 答案链接 剑指Offer
67 ba zi fu chuan zhuan huan cheng zheng shu lcof 答案链接 剑指Offer
68 er cha sou suo shu de zui jin gong gong zu xian lcof 答案链接 剑指Offer
68 er cha shu de zui jin gong gong zu xian lcof 答案链接 剑指Offer

About

the practice of algorithm in LeetCode. 400 questions has been resolved

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages