Maximum Product of Three Numbers
Leetcode problem 628; Difficulty: Easy
Problem Statement
Given an integer array nums, find three numbers whose product is maximum and return the maximum product.
Constraints:
3 <= nums.length <= 10000-1000 <= nums[i] <= 1000
Example 1:
Input: nums = [1,2,3]
Output: 6
Example 2:
Input: nums = [1,2,3,4]
Output: 24
Example 3:
Input: nums = [-1,-2,-3,-4]
Output: -6
Example 4:
Input: nums = [-1,-2,-3,4]
Output: 24
Example 5:
Input: nums = [-1,-2,-3, 2, 4, 5]
Output: 40
Submitted Solution
The implemented solution received the following rating on Leetcode:
