Input problem. Please Help


#1
A : " aabbbabaaabbbabaabaab"
B : [ "bababbbb", "bbbabaa", "abbb", "a", "aabbaab", "b", "babaabbbb", "aa", "bb" ]

I checked the above input on Leetcode. My code got correct answer in leetcode.
But in this  InterviewBit platform, it shows WA for above input.
What's wrong?
My code=>


struct node
{
  node *next[26];
  bool ck;
  node()
  {
      for(int i=0;i<26;i++)this->next[i]=NULL;
      this->ck=false;
  }
};
unordered_map<int,vector<string> >seen;
void Build(node *root,string x)
{
    int len=x.size();
    for(int i=0;i<len;i++)
    {
        int num=x[i]-'a';
        if(root->next[num]==NULL)root->next[num]=new node();
        if(i==len-1)root->next[num]->ck=true;
        root=root->next[num];
    }
}

vector<string>go(node *root,int i,int j,string &A)

{
    if(seen.find(i)!=seen.end())return seen[i];
    vector<string>subAns;
    node *take=root;
    string newX="";
    for(int k=i;k<=j;k++)
    {
        int num=A[k]-'a';
        newX+=A[k];
        if(take->next[num]==NULL)break;
        if(take->next[num]->ck){
            if(k==j)subAns.push_back(newX);
            else{
                vector<string>it=go(root,k+1,j,A);
                for(string &cat:it){
                    subAns.push_back(newX+" "+cat);
                }
            }
        }
        take=take->next[num];
    }
    seen[i]=subAns;
    return subAns;
}
vector<string> Solution::wordBreak(string A, vector<string> &B) {

    node *root=new node();
    for(int i=0;i<B.size();i++)Build(root,B[i]);
    
    vector<string>ans;
    ans=go(root,0,A.size()-1,A);
    sort(ans.begin(),ans.end());
    return ans;
}
    
    /*
    
    aabbbabaaabbbabaabaab
9  bababbbb bbbabaa abbb a aabbaab b babaabbbb aa bb
*/