本蒟蒻十分的菜,请不要在评论区嘲讽哦
#include<bits/stdc++.h>
using namespace std;
string x,y;
int lenx,leny;
void dfs(int l1,int r1,int l2,int r2){
if(l1>=r1||l2>=r2) return;
int m=x.find(y[l2]);
cout<<y[l2];
dfs(l1,m-1,l2,m-1+(l2-l1-m));
dfs(m+1,r2,m+1,r2);
}
int main(){
cin>>x>>y;
lenx=x.size(),leny=y.size();
dfs(0,lenx,0,leny);
}