我寻思着测试点二也没错啊怎么就WA了

#include <iostream>
using namespace std;
#include <string>
string s1,s2;
string s;
void build(string m,string n,int len,int k)
{
s[k]=n[len-1];
if(len>1)
{
int b=m.find(s[k]);
if(b>0)
{
string t1=m.substr(0,b);
string u1=n.substr(0,b);
build(t1,u1,b,2*k);
}
if(len-b-1>0)
{
string t2=m.substr(b+1,len-b-1);
string u2=n.substr(b,len-b-1);
build(t2,u2,len-b-1,2*k+1);
}
}
else return;
}
void dfs(int k)
{
cout<<s[k];
if(s[2*k]!=0) dfs(2*k);
else return;
if(s[2*k+1]!=0) dfs(2*k+1);
else return;
}
int main(){
cin>>s1>>s2;
int l=s1.size();
build(s1,s2,l,1);
dfs(1);
}