My whole code is correct why my test case gone wrong

import java.util.Scanner;

public class Main {

public static void main(String[] args) {
	// TODO Auto-generated method stub
	Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
	int [] arr = new int[n];
	for (int i = 0; i < arr.length; i++) {
		arr[i] = sc.nextInt();
    }
     	int[] ans = product(arr);
     	for (int i = 0; i < ans.length; i++) {
     		System.out.print(ans[i]+" ");
		}

}
 public static int[] product(int[]arr)          // in case of array returning int[] this will be the syntax
 {
	 int n = arr.length;
	 int [] left = new int [n];
	  left[0] = 1;
	 for (int i = 1; i < left.length; i++) {
		left[i] = left[i-1] * arr[i-1];
	}
       int [] right = new int[n];
    		right[n-1] = 1;
      for (int i = n-2; i >=0; i--) {
		right[i] = right[i+1] * arr[i+1];
	}
        for (int i = 0; i < right.length; i++) {
		   left[i] = left[i] * right[i];
		}
  	 return left;     
 }

}