The total number of raisins is T and the total number of cookies is n. Write down a dynamic programming algorithm with O(nT) time complexity that you think the professor has come up with. Explain why it works
A computer science professor has bought his two children a box of raisin cookies for thanksgiving. The number of raisins in the cookies is not evenly distributed and each cookie can have as many raisins in it. The children love raisins very much and when they open the box they fight over having as many raisins possible. They do not care about the number of cookies they have but rather the total number of raisins they collected. They are not happy with what they have collected, because each of them thinks the other one has more raisins. So they come back to their father for help. The professor comes up with a dynamic
Trending now
This is a popular solution!
Step by step
Solved in 2 steps