[Problem 25.4 EPIJ v 2.0.0]
Just a small note to the problem statement, when input is an array of size 1, the algorithm returns 1 (e.g. int product = 1;).
It might be a fairly reasonable return value, but there is no restriction given like “following has to be true: A.size() > 1” as far as I can see.
My own implementation returned same value (unintentionally coded), were just able to observe it through a unit test. I guess such one is easy to overlook.