Hi! Why does this solutions get Memory Limit Exceeded error? Submission page says that 57/57 test cases passed and last executed input was `[]`

.

```
/**
* @param {number[]} nums
* @return {number[][]}
*/
var findSubsequences = function(nums) {
if (nums.length === 0)
return [];
const res = [];
const DP = Array(nums.length).fill(0).map(v => []);
for (let i = 0; i < nums.length; i++) {
if (nums.indexOf(nums[i]) === i)
DP[i].push([nums[i]]);
}
for (let i = 0; i < nums.length; i++) {
for (let j = i - 1; j >= 0; j--) {
if (nums[j] > nums[i])
continue;
for (let k = 0; k < DP[j].length; k++) {
const seq = DP[j][k];
const newseq = seq.concat(nums[i]);
DP[i].push(newseq);
res.push(newseq);
}
if (nums[j] === nums[i])
break;
}
}
return res;
};
```