Here’s a detailed step-by-step method using the array [2, 3, -2, 4]: Start by initializing max_prod, min_prod, and max_result with the first element of the array. Begin iterating through the array from the second element onward. For each element, compute max_prod as the greatest value among the current element, the product of the current element with the previous max_prod, and the product of the current element with min_prod. Similarly, compute min_prod. Update max_result to be the greater of max_prod and max_result. Finally, return the value of max_result. By following this method, you will determine that the maximum subarray product for the given array is 6, achieved from the subarray [2, 3].