Skip to main content
LeetCode 628, Easy. Topics: Array, Math, Sorting. View on LeetCode. Generate this problem as a practice environment: tested reference solution, 16 parametrized pytest cases, and a playground notebook:

Problem

You are given an integer array nums. Find three numbers whose product is maximum and return the maximum product.

Examples

Constraints

  • 3 <= nums.length <= 10^4
  • -1000 <= nums[i] <= 1000

Solution

Reference implementation from solution.py on GitHub, full suite in test_solution.py:

Complexity

Tags

Last modified on September 7, 2026