product[i] = product[i] * right
Type your question above this line.
Course: https://www.educative.io/collection/5642554087309312/5634727314718720
Lesson: https://www.educative.io/collection/page/5642554087309312/5634727314718720/5639868793225216
product[i] = product[i] * right
Type your question above this line.
Course: https://www.educative.io/collection/5642554087309312/5634727314718720
Lesson: https://www.educative.io/collection/page/5642554087309312/5634727314718720/5639868793225216
Here we are multiplying product with the most right value in the array. In each iteration there will be a decrement with the right index which is specified in the loop. At initial point product is [1, 0, 0, 0]
, after each iteration the calculated product of the array values will be stored in it.
thank you for your explanation