java.lang.Object
g0601_0700.s0628_maximum_product_of_three_numbers.Solution

public class Solution extends Object
628 - Maximum Product of Three Numbers.<p>Easy</p> <p>Given an integer array <code>nums</code>, <em>find three numbers whose product is maximum and return the maximum product</em>.</p> <p><strong>Example 1:</strong></p> <p><strong>Input:</strong> nums = [1,2,3]</p> <p><strong>Output:</strong> 6</p> <p><strong>Example 2:</strong></p> <p><strong>Input:</strong> nums = [1,2,3,4]</p> <p><strong>Output:</strong> 24</p> <p><strong>Example 3:</strong></p> <p><strong>Input:</strong> nums = [-1,-2,-3]</p> <p><strong>Output:</strong> -6</p> <p><strong>Constraints:</strong></p> <ul> <li><code>3 <= nums.length <= 10<sup>4</sup></code></li> <li><code>-1000 <= nums[i] <= 1000</code></li> </ul>
  • Constructor Details

    • Solution

      public Solution()
  • Method Details

    • maximumProduct

      public int maximumProduct(int[] nums)