-
Notifications
You must be signed in to change notification settings - Fork 0
/
Amazon-leetcode.py
95 lines (65 loc) · 3.33 KB
/
Amazon-leetcode.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Amazon Interview Questions
Leetcode-Amazon
---------------------------------------------------------------------------
1. Two Sum Medium
20. Valid Parentheses Easy
21. Merge Two Sorted Lists Easy
160. Intersection of Two Linked Lists Easy
242. Valid Anagram Easy
167. Two Sum II - Input array is sorted Medium
48. Rotate Image Medium
186. Reverse Words in a String II Medium
89. Gray Code Medium
206. Reverse Linked List - Iterative Easy
206(2). Reverse Second Half of Linked Lists Medium
49. Group Anagrams- Sort, Hashmap Medium
23. Merge K Sorted Lists - Priority Queue/heap Hard
64. Minimal Path Sum Medium
199. Binary Tree Right Side View(DFS and BFS) Medium
200. Number of Islands - BFS, Union and Find Medium
78. Subsets - Bit Manipulation Medium
K Nearest Point to the Origin -- heap
98. Valid Binary Search Tree Medium
----
BST:对于当前node,左子树最大节点值 < node.val < 右子树最小节点值
235. Lowest Common Ancestor of a Binary Search Tree - BST Property Easy
102. Binary Tree Level Order Traversal - BFS Easy
100. Same Tree
000. Largest Binary Search Subtree(largest-bst-subtree) Hard
Note: check tree traversal, then O(n) solution, which is fun!
---
8. String to Integer (atoi) Easy
155. Min Stack Easy
204. Count Primes Easy
----------------------- To be finished ------------------------
239. Sliding Maximum Window - deque Hard
146. LRU Cache Hard
5. Longest Palindromic Substring - Center Expand/DP Medium
Tree Traversal in all kinds of orders
BFS
DFS
总结,那些题用bfs,dfs, e.g. 看到K max, min就用heap
Computer Science 文档:
http://wdxtub.com/interview/14520597062776.html
5. Longest Palindromic Substring - Center Expand/DP Medium
8. String to Integer(atoi) Easy
23. Merge K Sorted Lists - Priority Queue Hard
48. Rotate Image Medium
49. Group Anagrams- Sort Medium
78. Subsets - Bit Manipulation Medium
89. Gray Code Medium
98. Valid Binary Search Tree Medium
100. Same Tree.cpp
146. LRU Cache Hard
155. Min Stack Easy
167. Two Sum II - Input array is sorted Medium
186. Reverse Words in a String II Medium
199. Binary Tree Right Side View Medium
200. Number of Islands - BFS, Union and Find Medium
204. Count Primes Easy
206. Reverse Linked List - Iterative Easy
239. Sliding Maximum Window - deque
242. Valid Anagram Easy
Binary Tree Minimal Path Sum
K Nearest Point to the Origin
Reverse Second Half of Linked List