Sign of the Product of an Array || Solution
\n\n# Approach\n. Take a Variable Count and initialy intialize with zero.\n. Traverse the Array Element from 0 to less than Array size.\n. Check if Array Elemen
\n\n# Approach\n. Take a Variable Count and initialy intialize with zero.\n. Traverse the Array Element from 0 to less than Array size.\n. Check if Array Element is less than 0, then increment the count variable with 1(count++).\n. Again Check else if Array Element is equal to 0, then return 0.\n\nOut side the loop check if count is odd then return -1.\notherwise return 1.\n\n# Complexity\n- Time complexity:\n    O(n)\n\n- Space complexity:\n    O(1)\n\n# Code\nC++ || Easy Solution || Beats 90% Runtime ||\n```\nclass Solution {\npublic:\n    int arraySign(vector<int>& nums) {\n        int count = 0;\n        for(int i = 0; i < nums.size(); i++){\n            if(nums[i] < 0){\n                count++;\n            }\n            else if(nums[i] == 0){\n                return 0;\n            }\n        }\n        if(count & 1){\n            return -1;\n        }\n        return 1;\n    }\n};\n```
['C++']