What is time complexity of my solution


#1
string a, b;

int dp[100][100][100];

int deepee(int i1, int j1, int i2)
{
    if (dp[i1][j1][i2] != -1)
        return dp[i1][j1][i2];
    int &ret = dp[i1][j1][i2];
    
    // int j2 = i2 + j1 - i1;
    int n = j1 - i1 + 1;
    int j2 = i2 + n - 1;
    string first = a.substr(i1, n);
    string second = b.substr(i2, n);
    if (first == second)
        return ret = true;
    bool curr = false;
    for (int i = 0; i < n - 1; i++)
    {
        curr = curr || (deepee(i1, i1 + i, i2) && deepee(i1 + i + 1, j1, i2 + i + 1));
        curr = curr || (deepee(i1, i1 + i, j2 - i) && deepee(i1 + i + 1, j1, i2));
        if (curr)
            return ret = true;
    }
    
    return ret = false;
}

int Solution::isScramble(const string A, const string B) {
    a = A;
    b = B;
    if (a.length() != b.length())
        return false;
    memset(dp, -1, sizeof(dp));
    int n = a.length();
    deepee(0, n - 1, 0);
    
    return dp[0][n - 1][0];
}

Can someone comment on the time complexity of this code. I think this is O(n^4).