Optimized longest common subsequence algorithm with O(N + M) memory and wrote it in C++ http://reviewboard.infoarena.ro/r/70/