Java | Simple math | Beats 100% | 5 lines
Complexity\n- Time complexity: O(n)\n Add your time complexity here, e.g. O(n) \n\n- Space complexity: O(1)\n Add your space complexity here, e.g. O(n) \n\n# Co
# Complexity\n- Time complexity: $$O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n  public int arraySign(int[] nums) {\n    var sign = 1;\n\n    for (var n : nums) {\n      if (n == 0) return 0;\n      sign *= n > 0 ? 1 : -1;\n    }\n    return sign;\n  }\n}\n```\nIf you like my solution, please upvote it!
['Array', 'Math', 'Java']