Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Weekly Plan] Day 7 - 12. (New Start) | 2/18 - 2/22 #93

Open
12 tasks
tech-cow opened this issue Feb 18, 2020 · 6 comments
Open
12 tasks

[Weekly Plan] Day 7 - 12. (New Start) | 2/18 - 2/22 #93

tech-cow opened this issue Feb 18, 2020 · 6 comments
Projects

Comments

@tech-cow
Copy link
Owner

tech-cow commented Feb 18, 2020

Week 2 | Day 1

Goal

  • Focus on High Freq Qs

560. Subarray Sum Equals K (x7)

  • 560. Subarray Sum Equals K

Variation
Non-negative # using sliding window.


301. Remove Invalid Parentheses (X8)

  • 301. Remove Invalid Parentheses

Return only one solution

  • 20. Valid Parentheses
  • 921. Minimum Add to Make Parentheses Valid
  • 32. Longest Valid Parentheses
  • 1249. Minimum Remove to Make Valid Parentheses

  • 98. Validate Binary Search Tree (x5)
  • 269 Alien Dictionary (x3)
  • 133 Clone Graph (x2)
  • 76. Minimum Window Substring (x2)
  • 953. Verifying an Alien Dictionary (x2)

621 Task Scheduler (x2)

  • 621 Task Scheduler

Variation (English):

  1. Task's order is fixed, find the last task finished time
  2. What if Tasks' quantities are way larger than the cooldown time (Scan Task)
  3. What if the cooldown time is way larger than the tasks' quantities (Queue + Sliding Window)

Variation (Chinese):
给的是task顺利固定,要求最后一个task完成的时间。用hashmap记录一下上一个相同task的完成时间,然后和cool down time比较一下就可以了。follow up是更加优化一下空间,我说的是如果一个task执行完之后,时间过了cool down time就可以把它从map里面remove掉了,没有要写出来。每一题都问了复杂度。
近期高频,两个follow up:
task个数远大与cooldown ===》 scan task
cooldown远大与task个数 ===》 queue with sliding window

@tech-cow tech-cow created this issue from a note in Facebook (Unsolved) Feb 18, 2020
@tech-cow tech-cow changed the title Day 7. (New Start) | 2/18/20 Day 7 - 12. (New Start) | 2/18 - 2/22 Feb 18, 2020
@tech-cow
Copy link
Owner Author

tech-cow commented Feb 18, 2020

Week 2 | Day 2

Goal

  • Focus on High Freq Qs

Leetcode

29. Divide Two Integers (x3)

  • 29. Divide Two Integers

Pathrise: Divide without Divide or Mod (x2)
https://docs.google.com/document/u/1/d/1v69L_OUGAIFpWZ1SiswqTo3KmlbAf8GiR0T4yz7oTkY/edit

65. Divide Two Integers (x3)

  • 65. Valid Number (x2)

简化:只需要判断符号和小数,其他全部不用判断,比如首尾空格和e之类的
https://leetcode.com/problems/valid-number/
https://leetcode.com/problems/valid-number/discuss/23728/A-simple-solution-in-Python-based-on-DFA

  • 42 Trapping Rain Water (x2)
  • 11. Container With Most Water
  • 973 K Closest Points to Origin (Quick Select) (x2)
  • 211. Add and Search Word - Data Structure Design (x2)
  • 3. Longest Substring Without Repeating Characters (x2)
  • 297. Serialize and Deserialize Binary Tree (x4)

@tech-cow
Copy link
Owner Author

tech-cow commented Feb 18, 2020

Week 2 | Day 3

Goal

  • Focus on High Freq Qs

Leetcode

  • Next Permutation (x2)
  • 426. Convert Binary Search Tree to Sorted Doubly Linked List (x2)
  • 54 Spiral Matrix (x2)
  • 59 Spiral Matrix II
  • 885 Spiral Matrix III
  • 207 Course Schedule (x2)
  • 158. Read N Characters Given Read4 II - Call multiple times

@158 Clean up code
@885 Figure out the time complexity

@tech-cow
Copy link
Owner Author

Week 2 | Day 4

Goal

  • All Trees

Leetcode

  • 230. Kth Smallest Element in a BST
    • 如果n是已知的一个不变的数字,能否略过某些步骤?
    • 如果树是满的,能否略过某些步骤?
  • 865 Smallest Subtree with all the Deepest Nodes
  • 173. Binary Search Tree Iterator
    • 对于pre-order和in-order顺序,分别实现hasNext()和next()方法
  • 102. Binary Tree Level Order Traversal
  • 285 Inorder Successor in BST
  • 226 Invert Binary Tree
  • 297. Serialize and Deserialize Binary Tree
  • 236. Lowest Common Ancestor of a Binary Tree

@tech-cow
Copy link
Owner Author

Week 2 | Day 5

Goal

  • All Graph

Leetcode

  • Regular
    • 133. Clone Graph
      • What about Directed Graph?
  • Matrix
    • 417. Pacific Atlantic Water Flow
    • 329 Longest Increasing Path in a Matrix
    • 489. Robot Room Cleaner
  • Topological Sort
    • 269. Alien Dictionary
    • 207. Course Schedule

@tech-cow
Copy link
Owner Author

tech-cow commented Feb 18, 2020

Week 2 | Day 6

Goal

DFS / Backtracking

Leetcode

  • 301 Remove Invalid Parentheses
  • 78. Subsets
  • 567. Permutation in String
  • 79. Word Search
    • Could Trie improves Speed?
  • 126 Word Ladder II
  • 721. Accounts Merge
  • 10. Regular Expression Matching
    • 变种 regex变成“+”,“*”(我的妈,上来我一看题就知道要挂...我用dp写的,但是天竺小哥说最好用recursion..)

@tech-cow tech-cow changed the title Day 7 - 12. (New Start) | 2/18 - 2/22 [Weekly Plan] Day 7 - 12. (New Start) | 2/18 - 2/22 Feb 19, 2020
@tech-cow
Copy link
Owner Author

sliding window problems: 76,438, 567

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Facebook
  
To-Do
Development

No branches or pull requests

1 participant