Created
March 30, 2016 23:32
-
-
Save arkilis/444078f42fdaf3bea6ef348e9e70d41d to your computer and use it in GitHub Desktop.
lc238_solution1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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