C++ Solution || Using Modified Kadane Algorithm
\n    int maxLenFwd(vector<int> &vec)\n    {\n        int ccou = 0, cpro = 1;\n        int fcou = 0;\n        for (int i = 0; i < vec.size(); i++)\n        {\n 
```\n    int maxLenFwd(vector<int> &vec)\n    {\n        int ccou = 0, cpro = 1;\n        int fcou = 0;\n        for (int i = 0; i < vec.size(); i++)\n        {\n            if (vec[i] != 0)\n            {\n                cpro *= (vec[i] / abs(vec[i]));\n                ccou++;\n            }\n            else {\n                cpro *= vec[i];\n                ccou++;\n            }\n            if (cpro == 0)\n            {\n                cpro = 1;\n                ccou = 0;\n            }\n            if (cpro > 0 && ccou > fcou)\n            {\n                fcou = ccou;\n            }\n        }\n        return fcou;\n    }\n    int maxLenBck(vector<int> &vec)\n    {\n        int ccou = 0, cpro = 1;\n        int fcou = 0;\n        for (int i = vec.size() - 1; i >= 0; i--)\n        {\n            if (vec[i] != 0)\n            {\n                cpro *= (vec[i] / abs(vec[i]));\n                ccou++;\n            }\n            else {\n                cpro *= vec[i];\n                ccou++;\n            }\n            if (cpro == 0)\n            {\n                cpro = 1;\n                ccou = 0;\n            }\n            if (cpro > 0 && ccou > fcou)\n            {\n                fcou = ccou;\n            }\n        }\n        return fcou;\n    }\n    int getMaxLen(vector<int> &nums)\n    {\n        return max(maxLenFwd(nums), maxLenBck(nums));\n    }\n```
['Dynamic Programming', 'C', 'C++']