We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Magic Spells
You are viewing a single comment's thread. Return to all 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.