Java Easy Solution
class Solution {\n\n    public int getMaxLen(int[] nums) {\n\n        //first negative index check\n        \n        //count even is zeroIndex consider => curr
class Solution {\n\n    public int getMaxLen(int[] nums) {\n\n        //first negative index check\n        \n        //count even is zeroIndex consider => current position - zeroIndex (negative index ignore)\n        //count odd is current position - first negative index                \n        int result = 0;\n        int count = 0;\n        int firstNegative = -1;\n        int zeroIndex = -1;\n        \n        for(int i = 0; i < nums.length; i++) {\n            if(nums[i] < 0) {\n                if(firstNegative == -1) firstNegative = i;\n                count++;\t\t\t\t\n            }\n            \n            if (nums[i] == 0) {\n                count = 0;\n                firstNegative = -1;\n                zeroIndex = i;\n            }\n            \n            else {\n                if(count%2 == 0) result = Math.max(i - zeroIndex, result);\n                else result = Math.max(i - firstNegative, result);\n            }\n        }\n\n    return result;\n    }\n}
['Java']