标签:规律 item subject 数组 div code span title port
import java.util.ArrayList; public class Solution { public int[] multiply(int[] A) { int len = A.length; int[] B = new int[len]; if(len == 0) return B; int[] C = new int[len]; B[0] = 1; C[len-1] = 1; for(int i = 1; i < len; i++) { B[i] = B[i-1] * A[i-1]; } for(int i = len - 2; i >= 0; i--) { C[i] = C[i+1] * A[i+1]; B[i] = B[i] * C[i]; } return B; } }
标签:规律 item subject 数组 div code span title port
原文地址:https://www.cnblogs.com/yihangZhou/p/10504613.html