Tap here to switch tabs
Problem
Submissions

Problem: Sign of the Product of an Array

med
30 min
Try to solve the Sign of the Product of an Array problem.

Statement

Given an integer array nums, determine the sign of the product of all values in nums.

Return:

  • 11 if the product is strictly greater than 00.

  • −1-1 if the product is strictly less than 00.

  • 00 if the product is equal to 00.

Constraints:

  • 1≤1 \le nums.length ≤1000\le 1000

  • −100≤-100 \le nums[i] ≤100\le 100

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Sign of the Product of an Array

med
30 min
Try to solve the Sign of the Product of an Array problem.

Statement

Given an integer array nums, determine the sign of the product of all values in nums.

Return:

  • 11 if the product is strictly greater than 00.

  • −1-1 if the product is strictly less than 00.

  • 00 if the product is equal to 00.

Constraints:

  • 1≤1 \le nums.length ≤1000\le 1000

  • −100≤-100 \le nums[i] ≤100\le 100