lc238_solution2
def productExceptSelf2(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
aryRes = []
for index in range(len(nums)):
#print nums[:index], nums[index+1:]
product_left = reduce(lambda x,y:x*y,nums[:index]) if(nums[:index]!=[]) else 1
product_right = reduce(lambda x,y:x*y,nums[index+1:]) if(nums[index+1:]!=[]) else 1
aryRes.append(product_left*product_right)
return aryRes