package
0.0.0-20241125063422-a7e1e0bf04b0
Repository: https://github.com/blueblue0102/leetcode-go.git
Documentation: pkg.go.dev
# README
238. Product of Array Except Self
https://leetcode.com/problems/product-of-array-except-self/
給定 nums
陣列,回傳 ans
陣列,且 ans[i]
等於 nums[i]
以外的所有 element 相乘
不需要擔心乘法後的結果會超出 32bit
必須以 $O(n)$ 時間複雜度且不能進行除法
且題目是有機會以 $O(1)$ 的空間複雜度就可以解出(不含輸出的陣列空間)