WA IN NAME2

https://www.codechef.com/viewsolution/61923961

WHY I AM GETTING WRONG ANSWER

Hey @kamal2002
Congrats on posting your first query!

I think you misread the problem statement.

A man with name M is allowed to marry a woman with name W , only if M is a subsequence of W or W is a subsequence of M .

You have to check whether string a is a subsequence of string b or string b is a subsequence of string a.

I corrected the segment of your code below

if(isSubSequence(a,b,n1,n2)||isSubSequence(b,a,n2,n1))
	    cout<<"YES"<<endl;