The DFS solution has a time complexity of O(2^n) while DP solution only takes about O(n^3). My DFS solution takes about 56ms, but my DP solution below takes more than 100ms, which makes me very confused. Can someone please tell me how to improve my DP code or provide one that takes less time than the DFS solution?

```
//DP solution.
vector<vector<string> > partition(string s) {
const int len = s.size();
vector<vector<string> > subPalins[len+1] ;
subPalins[0] = vector<vector<string> >();
subPalins[0].push_back(vector<string>());
bool isPalin[len][len];
for (int i = len - 1; i >= 0; --i)
{
for (int j = i; j < len; ++j)
{
isPalin[i][j] = (s[i] == s[j]) && ((j - i < 2) || isPalin[i+1][j-1]);
}
}
for (int i = 1; i <= len; ++i)
{
subPalins[i] = vector<vector<string> >();
for (int j = 0; j < i; ++j)
{
string rightStr = s.substr(j, i-j);
if (isPalin[j][i-1]) {
vector<vector<string> > prePartition = subPalins[j];
for (int t = 0; t < prePartition.size(); ++t)
{
prePartition[t].push_back(rightStr);
subPalins[i].push_back(prePartition[t]);
}
}
}
}
return subPalins[len];
}
```