public static int[] findProduct(int arr[])

{

```
// write your code here
int product = 1;
for(int i = 0; i < arr.length; i++) {
if (arr[i] != 0)
product *= arr[i];
}
for(int i = 0; i < arr.length; i++) {
if (arr[i] != 0) {
arr[i] = product / arr[i];
}
else {
arr[i] = product;
product *= 0;
}
}
return arr;
```

Hello guys and girls, Your test cases accepts this solution. The problem is that this solution is incorrect as it does not cater for test cases like this: {0, 0, 0, 4, 5} - in this case, my solution prints - {20, 0, 0, 0, 0} when the output should be {0, 0, 0, 0, 0}. The problem with your course is that you guys do not have rigorous and intense test cases and I’ll be honest I am severely disappointed as I paid so much of money as a student to get this course. I am genuinely upset because you guys have such little test cases whereas websites such as geeksforgeeks and leetcode have the same problems free of charge with over 400 test cases designed to catch poor code.

This piece of code here:

int product = 1;

int nonZeroProduct = 1;

int countZeros = 0;

for(int i = 0; i < arr.length; i++) {

```
product *= arr[i];
if (arr[i] != 0) {
nonZeroProduct *= arr[i];
}
else {
countZeros++;
}
```

}

for(int i = 0; i < arr.length; i++) {

```
if (countZeros >= 2) {
arr[i] = 0;
}
else {
if (countZeros == 0) {
arr[i] = product / arr[i];
}
else if (countZeros == 1 && arr[i] == 0) {
arr[i] = nonZeroProduct;
}
else {
arr[i] = 0;
}
}
```

}

return arr;

Is actually a rigorous piece of code that successfully solves the problem for all possible test cases defined within the constraints of the problem definition. Please, please either fix this course and all it’s questions by adding a large dataset of test cases handcrafted to force the user to design rigorous code or compensate me accordingly as this investment is an unfortunate one if I’m being honest.

It’s genuinely sad that you guys don’t have a vast amount of rigorous and handcrafted test cases :C

Please assist, looking forward to hearing from you.

Thanks and best regards,

Hakeem