We consider the following sub-problem:opt takes two inputs i and the name M of the machine (either A or B) and returns the value of an optimal plan. Complete the algorithm.
def switch(a, b):
## assume a and b are 1-indexed and n = # min
opt[1, "A"] =
opt[1, "B"] =
for i in range( , ):
opt[ , "A"] =
opt[ , "B"] =
return max(opt[ , ], opt[ , ])