talks are shit show me the code
don\'t feel bad if you werent able to solve,neither i was few month ago, came back contemplated some highlits and solved,\nclass Solution {\n    public int getM
don\'t feel bad if you werent able to solve,neither i was few month ago, came back contemplated some highlits and solved,\n```class Solution {\n    public int getMaxLen(int[] nums) {\n        int ans=0;\n        int lp=0,ln=0,ni=-1,z=-1;\n        for(int j=0;j<nums.length;j++){\n                if(nums[j]==0){\n                  z=j;\n                    lp=0;\n                    ln=0;\n                    ni=-1;\n                }\n                else if(nums[j]>0){\n                    lp++;\n                    if(ln%2==0){\n                        ans=Math.max(ans,j-z);\n                        \n                    }\n                    else{\n                        ans=Math.max(ans,j-Math.max(z,ni));\n                    }\n                }\n                else if(nums[j]<0){\n                    ln++;\n                    if(ni==-1)ni=j;\n                    if(ln%2==0){\n                        ans=Math.max(ans,j-z);\n                    }\n                    else{\n                        ans=Math.max(ans,j-Math.max(z,ni));\n                    }\n                }\n                \n            }\n        \n        return ans;\n    }\n}\n```
['Java']