Maximum Length of Subarray With Positive Product :with Dry_run: Easy to understand
Dry Run\n\n\tnums[ ] : 1   2   3   5   -6   4   0   10\n\t\n    pos     : 1   2   3   4    0   1   0    1\n\t\n\tneg     : 0   0   0   0    5   6   0    0\n\n\n
**Dry Run**\n\n\tnums[ ] : 1   2   3   5   -6   4   0   10\n\t\n    pos     : 1   2   3   4    0   1   0    1\n\t\n\tneg     : 0   0   0   0    5   6   0    0\n\n\n\n```\n\nclass Solution {\npublic:\n    int getMaxLen(vector<int>& nums) {\n        int n = nums.size();\n        int pos = 0, neg = 0;\n        int ans = 0;\n        \n        for(int i = 0; i < n; i++){\n            \n            if(nums[i] == 0){\n                pos = 0;\n                neg = 0;\n            }\n            \n            else if(nums[i] > 0){\n                pos++;\n                neg = neg == 0 ? 0 : neg+1;\n            }\n            \n            else{\n                int temp = pos;\n                pos = neg == 0 ? 0 : neg+1;\n                neg = temp+1;\n            }\n            \n            ans = max(ans , pos);\n        }\n        \n        return ans;\n        \n    }\n    \n};\n```
['Dynamic Programming', 'C']