# -*- coding:utf-8 -*-
class Solution:
def multiply(self, A):
# write code here
tempA = [1 for _ in range(len(A))]
tempB = [1 for _ in range(len(A))]
for i in range(1, len(A)):
tempA[i] = tempA[i-1] * A[i-1]
for i in range(len(A)-2, -1, -1):
tempB[i] = tempB[i+1] * A[i+1]
for i in range(len(A)):
tempA[i] = tempA[i] * tempB[i]
return tempA
网友评论