At last!

The problem is 65A - Harry Potter and Three Spells, if you're curious.
Apparently, thinking before coding helps.
What is the longest it took you to upsolve a problem?