C++ || Solution || easy || faster
Intuition\nIf you go on to multiply each value and check the answer at last then checking the constraints you will get a overflow error for sure.\n\nWe have to 
# Intuition\nIf you go on to multiply each value and check the answer at last then checking the constraints you will get a overflow error for sure.\n\nWe have to find a solution without computing the entire values.\n\n# Approach\nFirst sort the entire vector and the ittitare till you find a positive or 0. Keep counting the number of occurances of negative values, if you encounter a zero then directly return 0 otherwise if count of negative is even then return 1 or else return -1.\n\n# Complexity\n- Time complexity:\n- O(nlogn)\n\n- Space complexity:\n- O(1)\n\n# Code\n```\nclass Solution {\npublic:\n    int arraySign(vector<int>& nums) {\n        sort(nums.begin(),nums.end());\n        int neg=0;\n        int pos=0;\n        for(int i=0;i<nums.size();i++)\n        {\n            if(nums[i]==0)\n            {\n                return 0;\n            }\n            else if(nums[0]>0)\n            {\n                return 1;\n            }\n            else{\n                if(nums[i]>0)\n                {\n                    break;\n                }\n                neg++;\n            }\n        }\n        if(neg%2==0)\n        {\n            return 1;\n        }\n        else{\n            return -1;\n        }\n    }\n};\n\n```
['C++']