✔✔✔Sign of the Product of an Array || C++ solution || Explained || Easy To understand
As  said that if the product of all the array element will negative than return -1, if the product will positive return 1 otherwise product is zero return 0. \n
As  said that if the product of all the array element will negative than return -1, if the product will positive return 1 otherwise product is zero return 0. \nthis is very easy we did not need to calculate the product of all array element just calculate how may negative value is there if total number of -ve value is even then product will surelly positive otherwise negative. if a single zero is present then only the product will zero.\n\nso  we calculate number of negative values and any zero if present.\nby doing this we can reduse the time comlexity.\nif we go to calculate product than there may be large value which generate some error.\nso this method is very good use.\n\nif you understand upvote.\n```\nclass Solution {  \npublic:\n    int arraySign(vector<int>& nums) \n    {\n        int c=0;\n        for(int i=0;i<nums.size();i++)\n        {\n            if(nums[i]==0)\n                return 0;\n            if(nums[i]<0)\n                 c++;\n        }\n        if(c%2==0)\n            return 1;\n        else\n            return -1;\n    }\n};\n```
[]