Coder Social home page Coder Social logo

tech-cow / leetcode Goto Github PK

View Code? Open in Web Editor NEW
1.3K 88.0 305.0 666 KB

👏🏻 leetcode solutions for Humans™

Python 100.00%
leetcode algorithm google python interview interview-questions interview-practice interview-preparation interview-test algorithms

leetcode's Introduction


yuzhoujr

公瑾现在提供以下服务哟!Contact me @ [email protected]
http://yuzhoujr.com/legacy/dummynode.pdf


Mock Interview 经验 + 反馈

Journey

时间线




Array Easy

# Title Solution Time Space Video
624 Maximum Distance in Arrays Python O(n) O(1)

Array Medium

# Title Solution Time Space Video
3 Longest Substring Without Repeating Characters Python O(n) O(n)
463 Island Perimeter Python O(n^2) O(1)

Hash Table Easy

# Title Solution Time Space Video
1 Two Sum Python O(n) O(n) 📺
242 Valid Anagram Python O(n) O(n)

Linked List Easy

# Title Solution Time Space Video
21 Merge Two Sorted Lists Python O(n) O(n)
89 Partition List Python O(n) O(n)
141 Linked List Cycle Python O(n) O(1)
160 Intersection of Two Linked Lists Python O(n) O(1)
203 Remove Linked List Elements Python O(n) O(1)
206 Reverse Linked List Python O(n) O(1)
234 Palindrome Linked List Python O(n) O(1)
83 Remove Duplicates from Sorted List Python O(n) O(1)

LinkedList Medium

# Title Solution Time Space Video
2 Add Two Numbers Python O(n) O(n)
445 Add Two Numbers II Python O(n) O(n)
142 Linked List Cycle II Python O(n) O(1) 📺
328 Odd Even Linked List Python O(n) O(1)
143 Reorder List Python O(n) O(1)
24 Swap Nodes in Pairs Python O(n) O(1)
148 Sort List Python O(nlogn) O(1)
61 Rotate List Python O(n) O(1)
19 Remove Nth Node From End of List Python O(n) O(1) 📺
138 Copy List with Random Pointer Python O(n) O(n)

Stacks Easy

# Title Solution Time Space Video
155 Min Stack Python O(1) O(n)
225 Implement Stack using Queues Python push/pop: O(1) top:O(n) O(n)
20 Valid Parentheses Python O(n) O(n)
346 Moving Average from Data Stream Python O(1) O(n)

Tree Easy

# Title Solution Time Space Video
110 Balanced Binary Tree Python O(N) O(h)
107 Binary Tree Level Order Traversal II Python O(N) O(h)
112 Path Sum Python O(N) O(h) 📺
100 Same Tree Python O(N) O(1)
101 Symmetric Tree Python O(N) O(1) 📺
104 Maximum Depth of Binary Tree Python O(N) O(1)
108 Convert Sorted Array to Binary Search Tree Python O(N) O(N) 📺
111 Minimum Depth of Binary Tree Python O(N) O(1)
235 Lowest Common Ancestor of a Binary Search Tree Python O(N) O(1)
226 Invert Binary Tree Python O(N) O(1) 📺
543 Diameter of Binary Tree Python O(N) O(h) 📺
501 Find Mode in Binary Search Tree Python O(N) O(N) 📺
257 Binary Tree Paths Python O(N) O(N) 📺
572 Subtree of Another Tree Python O(S*T) O(1) 📺
437 Path Sum III Python O(N^2) O(1)
404 Sum of Left Leaves Python O(N) O(1) 📺
270 Closest Binary Search Tree Value Python O(N) O(1) 📺
563 Binary Tree Tilt Python O(N) O(1) 📺
538 Convert BST to Greater Tree Python O(N) O(1) 📺
637 Average of Levels in Binary Tree Python O(N) O(1)

Tree Medium

# Title Solution Time Space Video
144 Binary Tree Preorder Traversal Python O(N) O(N) 📺
102 Binary Tree Level Order Traversal Python O(N) O(N) 📺
107 Binary Tree Level Order Traversal II Python O(N) O(N)
515 Find Largest Value in Each Tree Row Python O(N) O(1)
236 Lowest Common Ancestor of a Binary Tree Python O(N) O(1) 📺
199 Binary Tree Right Side View Python O(N) O(N) 📺
114 Flatten Binary Tree to Linked List Python O(N) O(1) 📺
230 Kth Smallest Element in a BST Python O(N) O(1) 📺
582 Kill Process Python O(N) O(N) 📺

Backtrack Medium

# Title Solution Time Space Video
78 Subsets Python O(N*(2^N)) O(2^N) 📺
90 Subsets II Python O(N*(2^N)) O(2^N) 📺
46 Permutations Python O(N*(N!)) O(N!) 📺
47 Permutations II Python O(N*(N!)) O(N!) 📺
60 Permutation Sequence Python O(N * (N!) O(N)
77 Combinations Python O(N*(N!)) O(N!)
39 Combination Sum Python O(K * (2^N) O(N) 📺
40 Combination Sum II Python O(K * (2^N) O(N) 📺
216 Combination Sum III Python O(K * (2^N) O(N)
17 Letter Combinations of a Phone Number Python O(N*(4^N)) O(N) 📺
131 Palindrome Partitioning Python O(N*(2^N)) O(N) 📺

Greedy Medium

# Title Solution Time Space Video
452 Minimum Number of Arrows to Burst Balloons Python O(N) O(1)

Dynamic Programming Easy

# Title Solution Time Space Video
70 Climbing Stairs Python O(N) O(1) Easy
53 Maximum Subarray Python O(N) O(N) Easy
198 House Robber Python O(N) O(N) Easy

Dynamic Programming Medium

# Title Solution Time Space Video
64 Minimum Path Sum Python O(N^2) O(M*N) 📺
62 Unique Paths Python O(N^2) O(M*N) Reference #64
55 Jump Game Python O(N^2) O(1) TLE with DP/Use Greedy for O(N) Solution
45 Jump Game II Python O(N^2) O(1) TLE with DP/Use Greedy for O(N) Solution
300 Longest Increasing Subsequence Python O(N^2) O(1) Use Binary-Search for NlogN Solution

BitMap Easy

# Title Solution Time Space Video
136 Single Number Python O(N) O(1) 📺

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Backers

Thank you to all our backers! 🙏 [Become a backer]

Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [Become a sponsor]

License

🌱 MIT @ Yu Zhou 🌱


home yuzhoujr.com  ·  github @yuzhoujr  ·  linkedin @yuzhoujr

leetcode's People

Contributors

monkeywithacupcake avatar sheng-ye-27 avatar tech-cow avatar yududu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

leetcode's Issues

Day 1 | 6/24

今日任务 (Binary Search)

  • 总结基础Binary Search模板,Iterative 以及 Recursive
  • 刷题

Leetcode Easy

852 Peak Index in a Mountain Array 70.1% Easy
349 Intersection of Two Arrays 48.5% Easy
167 Two Sum II - Input array is sorted 47.3% Easy
350 Intersection of Two Arrays II 44.2% Easy
744 Find Smallest Letter Greater Than Target 43.5% Easy

刷题任务

http://pythontutor.com/visualize.html#mode=display

重刷题目:

  • 15 3Sum
  • 16 3Sum Closest
  • 3. Longest Substring Without Repeating Characters

Lintcode

  • 607 Two Sum III - Data Structure Design
  • 143 Sort Colors II

Leetcode

  • 532 K-diff Pairs in an Array
  • 18 4Sum
  • 76 Minimum Window Substring
  • 763. Partition Labels
  • 828. Unique Letter String
  • 80. Remove Duplicates from Sorted Array II
  • 11. Container With Most Water

刷题状况:
15 3Sum : 细小的Bug, l初始值设置错位

Day 17 | 8/25

今日计划 | DP基础

Leetcode

  • 70 Climbing Stairs
  • 198 House Robber
  • 213 House Robber II
  • 221 Maximum Square
  • 300 Longest Increasing Subsequence

Day 10 | 7/10

刷题任务

热身重刷

  • 15 3Sum
  • 16 3Sum Closest

Leetcode

  • 3. Longest Substring Without Repeating Characters
  • 763. Partition Labels
  • 80. Remove Duplicates from Sorted Array II

Day 18 | 8/28

今日计划 | DP基础

Leetcode

  • 139. Word Break
  • 120. Triangle
  • 64. Minimum Path Sum
  • 343 Integer Break
  • 279 Perfect Squares
  • 62 Unique Paths
  • 63 Unique Paths
  • 309 Best Time to Buy and Sell Stock w/ CD

Day 16 | 8/18

今日计划 | DFS Backtacking

这几天其实状态很差。因为过多的焦虑导致整体的脑回路效率低下。
如果你也在刷题而且意志力消耗和我一样所剩无几,用今天的时间好好的放松大脑(远离一切干扰的那种)
至于如何面对20多天后的Onsite,其实今天我的友人也点醒了我,不要为了进Google而去面试,如此的针对反而会导致不必要的紧张
就好比游戏打排位,你太想打到期待的分数,反而会打乱自己游戏中的水平发挥,沉下心来把根基打好才是最重要的。所以心态放平整,就当这次面试是一次对目前水平的测量,过了说明自己的水平还行,没有说明自己还有很多的提升空间。
加油。

Leetcode

  • 39. Combination Sum
  • 40. Combination Sum II
  • 77. Combinations
  • 78. Subsets
  • 90. Subsets II
  • 131. Palindrome Partitioning
  • 132. Palindrome Partitioning II

Binary Search 总结帖 (更新完)

Binary Search

所有题目

Leetcode

Day 1

  • 852 Peak Index in a Mountain Array
  • 349 Intersection of Two Arrays
  • 167 Two Sum II - Input array is sorted
  • 350 Intersection of Two Arrays II
  • 744 Find Smallest Letter Greater Than Target

Day 2

  • 35 Search Insert Position
  • 278 First Bad Version
  • 367 Valid Perfect Square
  • 374 Guess Number Higher or Lower
  • 441 Arranging Coins
  • 69. Sqrt(x)

Day 3 - 6

  • 658. Find K Closest Elements
  • 162. Find Peak Element
  • 153. Find Minimum in Rotated Sorted Array
  • 74. Search a 2D Matrix
  • 34. Search for a Range
  • 240. Search a 2D Matrix II
  • 33. Search in Rotated Sorted Array
  • 81. Search in Rotated Sorted Array II

Lintcode

Day 3 - 5

  • 458. Last Position of Target
  • 585. Maximum Number in Mountain Sequence
  • 447. Search in a Big Sorted Array
  • 462. Total Occurrence of Target
  • 459. Closest Number in Sorted Array

题目的分类总结:

刷题先后顺序:

  • 有明确Target的Easy, Medium
  • 没有明确Target的Easy,Medium
    • 纳尼,你说你弄不懂到底返回left还是right,不慌,送你边界处理神器
    • 该神器的使用方法:把代码拷过去,然后initiatize一个object,随便传入一个Test Case,然后点运行。代码会一步一步的跑,你就可以看你leftright在每一层迭代之后的值了。
  • 没有明确Target的Easy,Medium (边界变种)

不用谢啦

Day 11 | 7/27

今日计划 | BFS

搜集BFS资源,以及针对经典题开刷。

Leetcode

  • 102. Binary Tree Level Order Traversal
  • 133. Clone Graph
  • 127. Word Ladder
  • 207. Course Schedule
  • 210. Course Schedule II

Lintcode

  • 127. Topological Sorting

Comeback Later:

  • 297. Serialize and Deserialize Binary Tree
  • 444. Sequence Reconstruction
  • 611. Knight Shortest Path

Day 5 | 7/2

今天任务以下题目:

今日任务 (Binary Search)

  • 继续被虐过程,总结总结总结。

刷题任务

热身,重刷Leetcode

  • 658. Find K Closest Elements
  • 162. Find Peak Element
  • 153. Find Minimum in Rotated Sorted Array

Lintcode

  • 462. Total Occurrence of Target
  • 459. Closest Number in Sorted Array

Leetcode

  • 74. Search a 2D Matrix
  • 34. Search for a Range

Day 12 | 8/7

今日计划 | DFS Tree

搜集DFS资源,以及针对经典题开刷。

Leetcode

  • 226. Invert Binary Tree
  • 104. Maximum Depth of Binary Tree
  • 559. Maximum Depth of N-ary Tree
  • 110. Balanced Binary Tree
  • 257. Binary Tree Paths
  • 114. Flatten the Binary Tree to Linked List
  • 270. Closest Binary Search Tree Value
  • 235 Lowest Common Ancestor of a Binary Search Tree
  • 236 Lowest Common Ancestor of a Binary Tree
  • 230. Kth Smallest Element in a BST
  • 98. Validate Binary Search Tree

Day 9 | 7/9

今日任务 (Two Pointers)

  • 看资源
  • 总结

刷题任务

Leetcode

  • 28 Implement strStr()
  • 15 3Sum
  • 16 3Sum Closest

Lintcode

  • 31. Partition Array
  • 587. Two Sum - Unique pairs
  • 533. Two Sum - Closest to target
  • 443. Two Sum - Greater than target

Day 11 | 7/14

今日计划

择日起,周末刷面经。今天Google面经一天

Easy(5)

  • 345 Reverse Vowels of a String
  • 246 Strobogrammatic Number
  • 844 Backspace String Compare
  • 276 Paint Fence
  • 359 Logger Rate Limiter

Medium(8)

  • 280 Wiggle Sort
  • 259 3Sum Smaller
  • 200 Number of Islands
  • 288 Unique Word Abbreviation
  • 289 Game of Life
  • 388 Longest Absolute File Path
  • 616 Add Bold Tag in String
  • 418 Sentence Screen Fitting

总结:

需要迅速补充以下知识点:DP, BFS, 递归

Day 4 | 7/1

今天任务以下题目:

今日任务 (Binary Search)

  • 巩固新的模板。
  • 用番茄工作法限制刷题时间。

刷题任务

热身,重刷Leetcode

  • 278 First Bad Version
  • 441. Arranging Coins
  • 69. Sqrt(x)

Lintcode

  • 458. Last Position of Target
  • 585. Maximum Number in Mountain Sequence
  • 447. Search in a Big Sorted Array

Leetcode

  • 658. Find K Closest Elements
  • 162. Find Peak Element
  • 153. Find Minimum in Rotated Sorted Array

Day 8 | 7/5

今日任务 (Two Pointers)

  • 盲目冲撞第二天,明天开始看总结和其他资源。

刷题

Leetcode

  • 844 Backspace String Compare
  • 88 Merge Sorted Array
  • 26 Remove Duplicates from Sorted Array
  • 141 Linked List Cycle

扫题 | 1

扫题

今天状态一般,扫一些Easy - Medium的题目练练手

Easy

  • 804 Unique Morse Code Words
  • 832 Flipping an Image
  • 728 Self Dividing Numbers
  • 561 Array Partition
  • 339 Nested List Weight Sum
  • 806 Number of Lines To Write String
  • 811 Subdomain Visit Count

Medium

  • 807 Max Increase to Keep City Skyline
  • 544 Output Contest Matches
  • 654 Maximum Binary Tree
  • 861 Score After Flipping Matrix
  • 797 All Paths From Source to Target

Day 13 | 8/9

今日计划 | DFS Tree

总结,熟练两种解决方法。

Leetcode

  • 144. Binary Tree Preorder Traversal
  • 94. Binary Tree Inorder Traversal
  • 145. Binary Tree Postorder Traversal
  • 110. Balanced Binary Tree
  • 111. Minimum Depth of Binary Tree
  • 104. Maximum Depth of Binary Tree
  • 285. Inorder Successor in BST
  • 112. Path Sum
  • 113. Path Sum II
  • 437. Path Sum III
  • 173. Binary Search Tree Iterator

Day 7 | 7/4

今日任务 (Two Pointers)

  • 用Easy试水。
  • 搜集资源,看视频/总结

刷题

Leetcode

  • 344 Reverse String
  • 283 Move Zeroes
  • 167 Two Sum II - Input array is sorted
  • 125 Valid Palindrome
  • 345 Reverse Vowels of a String

Day 6 | 7/3

今天任务以下题目:

今日任务 (Binary Search)

  • Binary Search最后一天,完成总结帖

刷题

Leetcode

  • 240. Search a 2D Matrix II
  • 33. Search in Rotated Sorted Array
  • 81. Search in Rotated Sorted Array II

joker 🙃

In a deck of cards, you have a joker and 52 other cards.

People work and sniff on asses to be one of the four aces, four kings, four queens, or four jacks. The rest? Bunch of random fucking numbers and a joker that is not worth anything.

You decided to be the joker because you decided that you're not worth anything right now. You can stay where you are and work your ways to be one of the aces, but I know you.

I know you would rather be the PLAYER because the player holds the cards. You don't want to be a card. You want to be the fucking player. The top motherfucking 5.

No pressure 💎

Yahoo | 电面

Yahoo面经

Leetcode

  • 387. First Unique Character in a String
  • 146. LRU Cache
  • 138. Copy List with Random Pointer
  • 205. Isomorphic Strings (Follow up: 给一堆string,把他们按照isomophic 给group起来)
  • 364. Nested List Weight Sum II (前边的数不是weight而是重复次数。让输出展开的串。用stack做)
  • 274. H-Index
  • 669. Trim a Binary Search Tree (remove all nodes less than a given value. Need to preserve the tree shape)(Use preorder and combine with inorder to achieve better time)
  • 166. Fraction to Recurring Decimal
  • 791. Custom Sort String
  • 153. Combination Sum II
  • 56. Merge Intervals (特殊interval,先排序下(2D array sorting))
  • 72. Edit Distance
  • 155. Min Stack
  • 54. Spiral Matrix
  • 17. Subsets (Both Recursive + Iterative)
  • 401. Binary Watch

Day 15 | 8/14

今日计划 | DFS Tree

继续啃DFS Tree
熟悉分制和遍历的两种思路

Leetcode

  • 543. Diameter of Binary Tree
  • 776. Split BST
  • 105. Construct Binary Tree from Preorder and Inorder Traversal
  • 106. Construct Binary Tree from Inorder and Postorder Traversal
  • 652.Find Duplicate Subtrees
  • 814. Binary Tree Pruning
  • 662.Maximum Width of Binary Tree
  • 742. Closest Leaf in a Binary Tree
  • 366. Find Leaves of Binary Tree

Day 2 | 6/25

今日任务 (Binary Search)

  • 继续熟练Binary Search的模板
  • 网上搜集类似的资源,看看有没有更加底层的架势。

Leetcode Easy

35 Search Insert Position 40.0% Easy
278 First Bad Version
367 Valid Perfect Square 38.8% Easy
374 Guess Number Higher or Lower 37.1% Easy
441 Arranging Coins 36.6% Easy
69 Sqrt(x) 29.2% Easy

以下没做出来,Roll Over
475 Heaters 29.8% Easy

Resume Template?

楼主可以发下简历的模版吗?很喜欢楼主简历的排版~

Leetcode上只要见到楼主的solution基本都点赞了,讲的真的很棒👍

Day 14 | 8/10

今日计划 | DFS Tree

继续啃DFS Tree
熟悉分制和遍历的两种思路

Leetcode

  • 100. Same Tree
  • 108. Convert Sorted Array to Binary Search Tree
  • 654.Maximum Binary Tree
  • 669. Trim a Binary Search Tree
  • 101. Symmetric Tree
  • 298. Binary Tree Longest Consecutive Sequence
  • 549. Binary Tree Longest Consecutive Sequence II

Binary Search (Easy)

题目
852 Peak Index in a Mountain Array 70.1% Easy
349 Intersection of Two Arrays 48.5% Easy
167 Two Sum II - Input array is sorted 47.3% Easy
350 Intersection of Two Arrays II 44.2% Easy
744 Find Smallest Letter Greater Than Target 43.5% Easy
270 Closest Binary Search Tree Value 41.0% Easy
35 Search Insert Position 40.0% Easy
367 Valid Perfect Square 38.8% Easy
374 Guess Number Higher or Lower 37.1% Easy
441 Arranging Coins 36.6% Easy
475 Heaters 29.8% Easy
69 Sqrt(x) 29.2% Easy
278 First Bad Version

Day 3 | 6/26

预算:
Medium开始,刷题前,先总结下返回left,和right的机制。

刷题总结:
没错,今天一题都没有做出来,难度跳跃有点大,明天不刷题,巩固基础Binary Search定义。。。

搁浅的题目
454 4Sum II # 这题更偏向Hash 表解法,Binary Search解法太牵强
392 Is Subsequence 还没刷到DP
230 Kth Smallest Element in a BST 还没刷到树

答案看不懂
378 Kth Smallest Element in a Sorted Matrix 45.8% Medium 这题用Priority Queue比较好做,Binary Search的答案目前看不懂 答案
287 Find the Duplicate Number 44.9% Medium 鸽笼原理....WTF

可否在其他平台同步打卡楼主的进度?

前几天想在微信上打卡刷Leetcode题目,今天看到楼主的计划感觉很科学。
想按照题主给出的计划同步做题打卡,不知道是否可以?

会申明计划来源,想让更多的人参与进来。

Day 19 | 8/29

今日计划 | Google面经

Leetcode

  • 560 Subarray Sum Equals K
  • 325 Maximum Size Subarray Sum Equals k

Sorting

Sort

  • Selection Sort
  • Merge Sort

Binary Search (Medium)

454 4Sum II 47.7% Medium
230 Kth Smallest Element in a BST 46.1% Medium
378 Kth Smallest Element in a Sorted Matrix 45.8% Medium
287 Find the Duplicate Number 44.9% Medium
392 Is Subsequence 44.7% Medium
718 Maximum Length of Repeated Subarray 41.9% Medium
436 Find Right Interval 41.6% Medium
153 Find Minimum in Rotated Sorted Array 41.2% Medium
162 Find Peak Element 39.3% Medium
240 Search a 2D Matrix II 39.2% Medium
300 Longest Increasing Subsequence 39.0% Medium
275 H-Index II 35.1% Medium
658 Find K Closest Elements 34.7% Medium
74 Search a 2D Matrix 34.6% Medium
81 Search in Rotated Sorted Array II 32.6% Medium
209 Minimum Size Subarray Sum 32.5% Medium
33 Search in Rotated Sorted Array 32.0% Medium
34 Search for a Range 31.7% Medium
222 Count Complete Tree Nodes 28.1% Medium
50 Pow(x, n) 26.3% Medium
29 Divide Two Integers 15.7% Medium

Facebook | 电面

Facebook电面

Leetcode 近期高频

  • 215. Kth Largest Element in an Array + 变种
  • 15. 3Sum
  • 76. Minimum Window Substring
  • 273. Integer to English Words
  • 146. LRU Cache
  • 560 Subarray Sum Equals K
  • 523. Continuous Subarray Sum
  • 905. Sort Array By Parity (283 Move Zero变种)
  • 173 Binary Search Tree Iterator
  • 199. Binary Tree Right Side View (每个节点的child node 个数不同)
  • 560. Subarray Sum Equals K (Overflow如何解决)
  • 387 First Unique Character in a String (1 Pass)
  • 33 Search in Rotated Sorted Array
  • 253 Meeting Rooms II
  • 145 Binary Tree Postorder Traversal (要求implement hasNext() 和 next() 两个方法)
  • 523. Continuous Subarray Sum
  • 621 Task Scheduler (Follow up)
  • 42. Trapping Rain Water
  • 301. Remove Invalid Parentheses
  • 349. Intersection of Two Arrays (有重复元素和无重复元素版本)
  • 65 Valid Number

Leetcode近期

  • 43. Multiply Strings
  • 341. Flatten Nested List Iterator
  • 314 Binary Tree Vertical Order Traversal
  • 31 Next Permutation
  • 91 Decode Ways
  • 32 Longest Valid Parentheses
  • 22 Generate Parentheses
    backtracking的初始情况 0,0 一开始写成0,n了,就卡了好久,面试官人很好给了hint
  • 110. Balanced Binary Tree
  • 543 Diameter of Binary Tree
  • 201 Bitwise AND of Numbers Range
  • 143 Reorder List
  • 347. Top K Frequent Elements
  • 13 Roman to Integer
  • 395. Longest Substring with At Least K Repeating
  • 636. Exclusive Time of Functions
  • 63 Unique Paths II
    可以上下左右走,返回布尔值,只要找到一条路径即可
  • 241. Different Ways to Add Parentheses
    Follow up:怎么判断decode出来是否正确
  • 680. Valid Palindrome II
  • 158 Read N Characters Given Read4 II
    Call multiple times next4000() 返回一个大小0-4000的list, 做一个nextn(n).
  • 103 Binary Tree Zigzag Level Order Traversal
  • 143. Reorder List
  • 689. Maximum Sum of 3 Non-Overlapping Subarrays
    先问只有一个subarray求最大和(直接扫一遍array就行,结果我写出了bug,耽误了10分钟),然后是3个subarray和,先让写brute-force,然后再慢慢优化。
  • 158. Read N Characters Given Read4 II - Call multiple times
  • 480 Sliding Window Median
    follow up是如果允许一个字母不一样
  • 49 Group Anagrams
  • 98 Validate Binary Search Tree
  • 138 Copy List with Random Pointer
  • 78 Subsets
  • 19 Remove Nth Node From End of List
  • 43 Multiply Strings
    clear了一下input,表示没有负数。
  • 277 Find the Celebrity
  • 46 Permutations
  • 785 Is Graph Bipartite?
  • 151 Reverse Words in a String
  • 282 Expression Add Operators
  • 215 Kth Largest Element in an Array
  • 170 Two Sum III - Data structure design
  • 238 Product of Array Except Self
  • 286. Walls and Gates
    https://www.geeksforgeeks.org/find-shortest-distance-guard-bank/
  • 721 Accounts Merge
  • 19. Remove Nth Node From End of List
  • 285 Inorder Successor in BST
  • 269 Alien Dictionary
  • 211. Add and Search Word - Data structure design
    直接用了trie tree, code 写完问了下complexity, follow up是虽然这个已经是optimal的方法,有没有可能让search更快一点,表示在insert的时候就把“.”也当做一个node加进去,比如如果insert “cat”, 那么第一层就是 “c”,".",第二层是“a”,"." | "a","."...
    然后大概问了十几分钟的complexity 真的非常晕 各种说错 各种提示 最后是把新旧两个方法的complexity都写下来........
    新旧两个方法都要写出以下:
    def insert_list_of_words 
    > Time Complexity
    
    def search pattern 
    > Time Complexity
    > Space Complexity
  • 189. Rotate Array
  • 79 Word Search
    word search: given a dictionary and start/end word, there is a path between the words with 1 edit distance. Output the path from start word to end word. followups: how about output all the paths? Another optimizations for the algorithm
  • 227 Basic Calculator II
  • 493 Reverse Pairs
  • 23 Merge k Sorted Lists
  • 438 Find All Anagrams in a String
  • 88 Merge sorted array

非Leetcode

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.