All prompts are owned by LeetCode. To view the prompt, click the title link above.
First completed : June 06, 2024
Last updated : July 01, 2024
Acceptance Rate : 65.34 %
int arraySign(int* nums, int numsSize) {
bool out = true;
for (int i = 0; i < numsSize; i++) {
if (nums[i] < 0)
out = !out;
if (!nums[i])
return 0;
}
return out ? 1 : -1;
}