Algo - greedy Flashcards

1
Q
  1. Task Scheduler

e. g. tasks A,B,C,A,A. Distance between 2 “A” must be at least N

A
  1. calc freqs, minIndices e.g. minIndices[A] is the min idx that can put A
  2. create findBestTaskIdx: the one that satisfies minIndices and with maxFreq
  3. Similar problems:
    a. 358. Rearrange String k Distance Apart
    b. “1953. Maximum Number of Weeks for Which You Can Work” but with big number of tasks
    c. “767. Reorganize String” with N = 1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly