[JAVA]☕ | Easy and Explained Solution ❤ | Speed Beats 100% ✔️
Approach\n Describe your approach to solving the problem. \nThe solution involves a simple iteration of the array, we can track the sign of the product without 
# Approach\n<!-- Describe your approach to solving the problem. -->\nThe solution involves a simple **iteration of the array**, we can track the **sign** of the product without actually make the operation.  \n\n*At each iteration* we have to do three operations:\n1) If the **number is zero**, `return 0` this because the product of every number with zero is zero;\n2) If the **number is negative**, change the sign of the result;\n3) If the **number is positive** go to the next iteration, this case does not change the sign of the result.\n\n**Note:** Is important *to not make the operation* because the product of lots of high numbers can generate an **overflow** (this happen when the operation attempts to create a numeric value that is outside of the range that can be represented with a given number of digits).\n\n# Complexity\n- **Time complexity:** $O(n)$\n- **Speed Beats:** 100%\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- **Space complexity:** $O(1)$\n- **Memory Beats:** 74.72%\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n    public int arraySign(int[] nums) {\n        \n        int sign = 1;\n\n        for (int i = 0; i < nums.length; i++) {\n            \n            if (nums[i] == 0)\n                return 0;\n            if (nums[i] < 0)\n                sign *= -1;\n        }\n\n        return sign;\n    }\n}\n```
['Java']