Magic Spells

  • + 0 comments

    The simple recursive solution does not have complexity of O(N^2) time. It is way much bigger, because of the branching. Take a look at Cormen's chapter on the problem.