C++ Easy Solution O(n)
we needs subarray having positive product means:\n\t-subarray having even number of negatives\n\t-and without zeros\n\n```\n int getMaxLen(vector nums) \n    { 
we needs subarray having positive product means:\n\t-subarray having even number of negatives\n\t-and without zeros\n\n```\n int getMaxLen(vector<int> nums) \n    { \n        int framestart = -1, firstneg = -2, len = 0, neg = 0;\n        for (int i = 0; i < nums.size(); i++) \n        {\n            if (nums[i] == 0) // reset everytime if zero\n            {  \n                neg = 0;framestart = i;firstneg = -2;\n            } \n            else \n            {\n                if (nums[i] < 0) neg++;  // number of negatives in  current frame means (frame excluding zero)\n                if (neg == 1 && firstneg == -2) firstneg = i;   // init firstneg cnt neg;\n                if (neg % 2 == 0) len = max(len, i - framestart);  //if curr cnt neg is framestart;\n                else len = max(len, i - firstneg);  // first firstneg after last zero;\n            }\n        }\n        return len;\n\n    }
[]