空气床实习店面挂经

第一轮
Alien Dictionary [https://leetcode.com/problems/alien-dictionary]

第二轮
I give you a box

  1. A box can either be locked or unlocked
  2. Inside the box you will find: # candy, # inner boxes, # keys
  3. Keys correspond to specific boxes
  • What is maximum number of candy you can retrieve?
  • EXAMPLE
  • I gave you box A
  • A = { unlocked, 7 candy, boxes=[B, C], keys=[] }
  • B = { locked, 5 candy, boxes=[D], keys=[] }
  • C = { unlocked, 4 candy, boxes=[], keys=[B] }
  • D = { locked, 100 candy, boxes=[], keys=[] }
  • I give you box A, what is the maximum # of candy you can retrieve? 16
  • HINT 1: Think, what are the conditions in which a box is “ready” to be opened?
  1. If you discover a new box and it is already unlocked
  2. I have previously found key X, and now I find locked box X
  3. I find key Y, and have already seen locked box Y

还是准备不够,最后挂了