[Java] 2 Straightforward Solutions
We only care about 0 and the occurence of negative numbers in the array. No need to calculate the final product.\n\n    public int arraySign(int[] nums) {\n    
We only care about 0 and the occurence of negative numbers in the array. No need to calculate the final product.\n```\n    public int arraySign(int[] nums) {\n        int counter = 0;\n        for (int i = 0; i < nums.length; i++) {\n            if (nums[i] == 0) {\n                return 0;\n            }\n            if (nums[i] < 0) {\n                counter++;\n            }\n        }\n        return counter % 2 == 0 ? 1 : -1;\n    }\n```\n\n```\n    public int arraySign(int[] nums) {\n        int sign = 1;\n        for (int i : nums) {\n            if (i == 0) return 0;\n            if (i < 0) sign *= -1;\n        }\n        return sign;\n    }\n```
[]