C++ - 2 Solutions - EASY UNDERSTANDING
 # Intuition  \n\n\n\n\n\n# Complexity\n- Time complexity:O(n)\n\n\n- Space complexity:O(1)\n\n\n# Code\nC++ []\nclass Solution {\npublic:\n    int arraySign(ve
<!-- # Intuition -->\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n<!-- # Approach -->\n<!-- Describe your approach to solving the problem. -->\n\n# 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```C++ []\nclass Solution {\npublic:\n    int arraySign(vector<int>& nums) {\n        int product = 1 ; \n        for (int i = 0 ; i < nums.size() ; i ++)\n        {\n            if (nums[i] == 0)\n            {\n                return 0 ; \n            }\n\n            else if (nums[i] < 0)\n            {\n                product *= -1 ; \n            }\n\n            else \n            {\n                product *= 1 ;\n            }\n        }\n        return product ; \n    }\n};\n```\n---\n# 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```C++ []\nclass Solution {\npublic:\n    int arraySign(vector<int>& nums) {\n        int product = 1 ; \n        for (int i = 0 ; i < nums.size() ; i ++)\n        {\n            if (nums[i] == 0)\n            {\n                return 0 ; \n            }\n\n            else if (nums[i] < 0)\n            {\n                product *= -1 ; \n            }\n\n            else \n            {\n                product *= 1 ;\n            }\n        }\n        return product ; \n    }\n};\n```\n![815a317f-9cdf-46e2-a397-af8869dafa2e_1673498197.3721023.png](https://assets.leetcode.com/users/images/7990c4ba-a757-4a76-9eed-0d4cba0b8b5c_1678339994.0675652.png)\n
['Array', 'Math', 'C++']