Skip to content

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

Open
@tech-cow

Description

@tech-cow

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions