Hi all!

So i’ve been working on this problem[ The white knight] and i first solved it using recursion which exceeded the time limit. So later i found out that their was a tutorial about this problem here :

http://www.codechef.com/wiki/tutorial-white-knight

However, what i dont understand is how does this approach i.e : dynamic programming, beat recursion in terms of time. Shouldnt it be the same?

I even tried memoization with recursion, but even that exceeded the time limit. Some help needed. And will be greatly appreciated.

Regards