Comments

exactly how i did

All you need is attention.For C,just dfs from en and output the index when backtracking.I found this after a long thought.

I got it.The ordinary LCS cannot tell which string is substring and which is subsequence.

So LCS is one of the wrong algorithms?

(At first, I wanted to use 01trie to maintain the times a configuration appeared but I think it would get a ME too.

For D I got the idea, but why if I use an unordered_map to keep track of how many time had a configuration appeared I will get a ME