题解 | 复制列表,计算pop后新列表乘积
构建乘积数组
http://www.nowcoder.com/practice/94a4d381a68b47b7a8bed86f2975db46
class Solution: def calcu(self, list1): sum1 = 1 for i in list1: sum1 *= i return sum1 def multiply(self, A): B = [] for i in range(len(A)): A1 = A[:] A1.pop(i) B.append(self.calcu(A1)) return B