Other than the product itself array
class Solution { public int[] productExceptSelf(int[] nums) { int len = nums.length; int[] leftji = new int[len]; leftji[0] = 1; int temp = 1; for(int i=1;i<len;++i){ leftji[i] = leftji[i-1]*nums[i-1]; } for(int i=len-1;i>=0;--i){ leftji[i] = leftji[i]*temp; temp = temp*nums[i]; } return leftji; } }