You are viewing a single comment's thread. Return to all comments →
worked as charm for all test cases
if someone has some uncleared test cases even after the above code then try applying this code :
var l1=s.length; var l2=t.length; var count=0; for(let i=0;i<l1;i++){ if(s[i]==t[i]){ count++; } else{ break; } } if(parseInt(l1-count)+parseInt(l2-count)<=k){ if(parseInt(l1)+parseInt(l2)<=k){ return "Yes"; } else if((k-(parseInt(l1-count)+parseInt(l2-count)))%2==0){ return "Yes"; } else return "No"; } else{ return "No"; }
Append and Delete
You are viewing a single comment's thread. Return to all comments →
worked as charm for all test cases
if someone has some uncleared test cases even after the above code then try applying this code :