Python DP solution with detailed explanation. Avoids confusion about factors of 2 or 3.
To find the max product of 8, break up 8 into the sum of two terms (keep the first term less than or equal to the second to prevent redundancy):\n\n\n1 + 7 --> 
To find the max product of 8, break up 8 into the sum of two terms (keep the first term less than or equal to the second to prevent redundancy):\n\n```\n1 + 7 --> 1 * 7 = 7\n2 + 6 --> 2 * 6 = 12\n3 + 5 --> 3 * 5 = 15\n4 + 4 --> 4 * 4 = 16\n```\n\nFrom this is seems that the max product 16, however we neglected to also break up each of the two terms into more terms, and check all those. Let\'s break the 6 into 3 + 3:\n\n```\n2 + 6 = 2 + 3 + 3 --> 2 * 3 * 3 = 18\n```\n\nwhich ends up being the correct answer. But another way to get this is to reuse the previously computed max product of 6, which we know to be 9:\n\n```\n2 * (3 * 3) = 2 * max_product_of_6 = 2 * 9 = 18\n```\n\nSo for each choice of i and j with i <= j and i + j = n, check i * j but ALSO check if the previously computed max products for i and j are larger than i and j. Start with n = 1 and build up to the final n. Store the previously computed values in a dp list.\n\n```\nclass Solution(object):\n    def integerBreak(self, n):\n        dp = [None, 1]\n        for m in range (2, n + 1):\n            j = m - 1\n            i = 1\n            max_product = 0\n            while i <= j:\n                max_product = max(max_product, max(i, dp[i]) * max(j, dp[j]))\n                j -= 1\n                i += 1\n            dp.append(max_product)\n        return dp[n]\n```
['Python']