DP Memoization Approach
\nvar integerBreak = function(n) {\n    let memo = new Map()\n    \n    function dp(n){\n        if(n == 1 || n == 2) return 1\n        if(memo.has(n)) return m
```\nvar integerBreak = function(n) {\n    let memo = new Map()\n    \n    function dp(n){\n        if(n == 1 || n == 2) return 1\n        if(memo.has(n)) return memo.get(n)\n        \n        let q = 0\n        for(let i=1; i<=n/2; i++){\n            q = Math.max(q, i * Math.max((n-i),dp(n-i)))\n        }\n        memo.set(n, q)\n        return q\n    }\n    return dp(n)\n};\n```\n\nThe time complexity is O(n^2). \nThere are `n/2` loops for the 1st recursive call, `(n-1)/2` for the 2nd call, and so on. \nTherefore the total number of loops is: ` n/2 + (n-1)/2 + (n-2)/2 + (n-3)/2 + (n-4)/2 + ... + (n-(n-3))/2` \nThis sum evaluates to an upper bound of: `(n*2 - n(n+1)/2)/2` \nwhich simplifies to `(n^2-n)/4`. Which is O(n^2)
['Dynamic Programming', 'Memoization', 'JavaScript']