deno.land / x / masx200_leetcode_test@10.6.5 / sign-of-the-product-of-an-array / index.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
export 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;}
masx200_leetcode_test

Version Info

Tagged at
a year ago