Home

Awesome

awesome-java-leetcode

我如今是一名 Android Developer,大学的我曾是一名 ACMer,我一直认为数据结构和算法是作为一名程序员必须掌握和善于利用的,为了不让数据结构和算法淡出我的记忆,所以我打算重拾 LeetCode 之 Algorithm,语言选择的是 Java,题库会一点点完善起来,按简单,中等,困难分类,相应难度下按题号排序,源代码在 src 目录中,相关解题都在 note 目录中,想要学习数据结构和算法或打算刷 LeetCode 的小伙伴们欢迎 star 哦。

如今有机会面试 Facebook,附上 LeetCode 上 Facebook 的面试题目序号,希望可以帮助到以后想入 Facebook 的小伙伴:-)

1,10,13,15,17,20,23,25,26,28,33,38,43,44,49,50,56,57,67,68,69,71,75,76
78,79,80,85,88,90,91,98,102,117,121,125,127,128,133,139,146,157,158,161
168,173,200,206,208,209,210,211,215,218,221,234,235,236,238,252,253,257
261,265,269,273,274,275,277,278,282,283,285,286,297,301,311,314,325,334
341,377,380,398,404,410,461,477,494,523,525,534,535,543,554

如果想知道更多公司 LeetCode 面试题,可以参看 Companies.md

附上镇楼诗:

明有科举八股,今有 LeetCode。
八股定格式而取文采心意,LeetCode 定题目且重答案背诵。
美其名曰:"practice makes perfect."
为何今不如古?
非也非也,
科举为国取士,LeetCode 为 Google 筛码工,各取所需也。

Easy

#TitleTag
1Two SumArray, Hash Table
7Reverse IntegerMath
9Palindrome NumberMath
13Roman to IntegerMath, String
14Longest Common PrefixString
16.11跳水板(Diving Board LCCI)递归、记忆化
20Valid ParenthesesStack, String
21Merge Two Sorted ListsLinked List
26Remove Duplicates from Sorted ArrayArray, Two Pointers
27Remove ElementArray, Two Pointers
28Implement strStr()Two Pointers, String
35Search Insert PositionString
38Count and SayString
53Maximum SubarrayArray, Divide and Conquer, Dynamic Programming
58Length of Last WordString
66Plus OneArray, Math
67Add BinaryMath, String
69Sqrt(x)Binary Search, Math
70Climbing StairsDynamic Programming
83Remove Duplicates from Sorted ListLinked List
88Merge Sorted ArrayArray, Two Pointers
100Same TreeTree, Depth-first Search
101Symmetric TreeTree, Depth-first Search, Breadth-first Search
104Maximum Depth of Binary TreeTree, Depth-first Search
107[Binary Tree Level Order Traversal II][107]Tree, Breadth-first Search
108Convert Sorted Array to Binary Search TreeTree, Depth-first Search
110Balanced Binary TreeTree, Depth-first Search
111Minimum Depth of Binary TreeTree, Depth-first Search, Breadth-first Search
112Path SumTree, Depth-first Search
118Pascal's TriangleArray
119Pascal's Triangle IIArray
121Best Time to Buy and Sell StockArray, Dynamic Programmin
122Best Time to Buy and Sell Stock IIArray, Greedy
543Diameter of Binary TreeTree

Medium

#TitleTag
2Add Two NumbersLinked List, Math
3Longest Substring Without Repeating CharactersHash Table, Two Pointers, String
5Longest Palindromic SubstringString, Dynamic Programming
6ZigZag ConversionString
8String to Integer (atoi)Math, String
11Container With Most WaterArray, Two Pointers
12Integer to RomanMath, String
153SumArray, Two Pointers
153Sum ClosestArray, Two Pointers
17Letter Combinations of a Phone NumberString, Backtracking
184SumArray, Hash Table, Two Pointers
19Remove Nth Node From End of ListLinked List, Two Pointers
22Generate ParenthesesString, Backtracking
24Swap Nodes in PairsLinked List
29Divide Two IntegersMath, Binary Search
33Search in Rotated Sorted ArrayArrays, Binary Search
43Multiply StringsMath, String
49Group AnagramsHash Table, String
50Pow(x, n)Math, Binary Search
56Merge IntervalsArray, Sort
63不同路径 II(Unique Paths II)数组、动态规划
209长度最小的子数组(Minimum Size Subarray Sum)数组、双指针、二分查找
215数组中的第K个最大元素(Kth Largest Element in an Array)堆、分治算法
554Brick WallHash Table
1014最佳观光组合(Best Sightseeing Pair)数组

Hard

#TitleTag
4Median of Two Sorted ArraysArray, Binary Search, Divide and Conquer
10Regular Expression MatchingString, Dynamic Programming, Backtracking
23Merge k Sorted ListsLinked List, Divide and Conquer, Heap
25Reverse Nodes in k-GroupLinked List
30Substring with Concatenation of All WordsHash Table, Two Pointers, String
44Wildcard MatchingString, Dynamic Programming, Backtracking, Greedy
57Insert IntervalArray, Sort
68Text JustificationString
1028从先序遍历还原二叉树(Recover a Tree From Preorder Traversal)树、深度优先搜索

打个小广告

欢迎加入我的小专栏「基你太美」一起学习。