x/masx200_leetcode_test/sign-of-the-product-of-an-array/index.ts
123456789export default function arraySign(nums: number[]): number { let ans = 1; for (const num of nums) { if (num === 0) return 0; ans *= Math.sign(num); } return ans;}