what An algorithm to watch a movie in a cinema hall
Answers
Answered by
1
Answer:
We can watch A at 15, B at 14, C at 17 and D at 20, so it's possible to watch them all. Note that you can't watch C at 15, not viable.
The problem as you have guessed, is whether we can watch them all.
Explanation:
Obviously we can solve it with backtracking, trying all possibilities. Is there better way to do it? I have an idea of starting with movies with least number of available times first, that way we can find the solution faster if there's a solution, the worst case
Similar questions