Did the provided official solution take 0 into consider?

public int maxProduct(int[] nums){ if(nums == null  nums.length == 0) return 0; if(nums.length == 1) return nums[0]; int localMax = nums[0]; int localMin = nums[0]; int global = nums[0]; for(int i = 1; i < nums.length; i++){ int maxCopy = localMax; localMax = Math.max(Math.max(nums[i] * localMax, nums[i]), nums[i] * localMin); localMin = Math.min(Math.min(nums[i] * maxCopy, nums[i]), nums[i] * localMin); global = Math.max(localMax, global); } return global; }