Python shortest 1-liner. Functional programming.
Approach\n1. Let sign be a function that returns 1 for positive numbers, -1 for negative, and 0 for zero. We can define this as:\nsign = lambda x: (x > 0) - (x 
# Approach\n1. Let `sign` be a function that returns `1` for positive numbers, `-1` for negative, and `0` for zero. We can define this as:\n`sign = lambda x: (x > 0) - (x < 0)`\n\n2. Apply `sign` to each number in `nums`.\n\n3. Return the product of the signs.\n\n# Complexity\n- Time complexity: $$O(n)$$\n\n- Space complexity: $$O(1)$$\n\nwhere, `n is length of nums`.\n\n# Code\n```python\nclass Solution:\n    def arraySign(self, nums: list[int]) -> int:\n        return reduce(mul, map(lambda x: (x > 0) - (x < 0), nums))\n\n\n```
['Array', 'Math', 'Python', 'Python3']