Skip to content

Instantly share code, notes, and snippets.

@arkilis
Created March 30, 2016 23:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arkilis/444078f42fdaf3bea6ef348e9e70d41d to your computer and use it in GitHub Desktop.
Save arkilis/444078f42fdaf3bea6ef348e9e70d41d to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment