Skip to content

Practice Integer Break

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Medium#343
LeetCode Problem

Integer Break

Problem Statement

Given an integer n, break it into the sum of k positive integers, where k >= 2, and maximize the product of those integers. Return the maximum product you can get.

Source: Integer Break on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
n = 2
Output
1

# Example 2

Input
n = 10
Output
36

Constraints

2 <= n <= 58

Related LeetCode Problems

Practice more problems similar to Integer Break.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.