arkilis
3/30/2016 - 11:32 PM

lc238_solution1

lc238_solution1

class Solution(object):
    # Solution 1
    # not passing the performance requirements
    def productExceptSelf1(self, nums):
        """
        :type nums: List[int]
        :rtype: List[int]
        """
        aryRes = []
        import copy
        for e in nums:
            tmpNums= copy.deepcopy(nuts) # line 12
            tmpNums.remove(e)
            Res.append(reduce(lambda x,y:x*y, tmpNums))
        return aryRes