Integer Break

Medium · Dynamic Programming · about 15 minutes

Asked at Meta, Google, Microsoft, Amazon, Bloomberg.

Write the integer n (2 ≤ n ≤ 58) as a sum of two or more positive integers, choosing the parts so their product is as large as possible. Return that product.

Related guides