```
class Solution:
# @param {integer[]} nums
# @return {integer[]}
def productExceptSelf(self, nums):
if len(nums) <= 1: return []
prod = [1] * len(nums)
for i in range(1, len(nums)):
prod[i] = prod[i-1] * nums[i-1]
RightProd = 1
for i in range(len(nums)-2, -1, -1):
RightProd = RightProd * nums[i+1]
prod[i] = prod[i+1] * RightProd
return prod
```

When I submit, it shows "Memory Limit Exceeds"? Why? Or any improvement?