题解 | #构建乘积数组#
构建乘积数组
https://www.nowcoder.com/practice/94a4d381a68b47b7a8bed86f2975db46
#include <vector> class Solution { public: vector<int> multiply(const vector<int>& A) { vector<int> B; for(int i=0;i<A.size();i++){ int t=1; for(int j=0;j<i;j++){ t*=A[j]; } for(int j=A.size()-1;j>i;j--){ t*=A[j]; } B.push_back(t); } return B; } };