i came across this question .it is from codenation and i have not participated .i am thinking of longest common sequence approach.then Complexity will be O(n*m).can we do any better? thank u.