You are viewing a single comment's thread. Return to all comments →
I decided to read the discussion page before solving the actual problem since I can't believe what I see.
The most interesting part is not that you have to solve the LCS problem which is, by the way, much more complicated than dynamic casts in C++. The real fun begins when you realize that the only thing that you can edit is the body of a single function!
This means that you can't use recursion solving the LCS! You must unroll the structure of the problem "by hand" using some array, as it was shown below. I tried some tricks with local lambdas or std::function which didn't work, especially that I cannot include the header "functional". But maybe I didn't try hard enough :)
This is just crazy...