Random commentary about Machine Learning, BigData, Spark, Deep Learning, C++, STL, Boost, Perl, Python, Algorithms, Problem Solving and Web Search

int prod = 0;foreach(int i : vector) prod *= i;for (int idx = 0; idx < N; ++idx) { vector[idx] = prod/vector[idx];}

int prod = 0;

ReplyDeleteforeach(int i : vector) prod *= i;

for (int idx = 0; idx < N; ++idx) {

vector[idx] = prod/vector[idx];

}