[C++] Recursion --> DP Memoization --> DP Tabulation
Method 1: RECURSION\n\nclass Solution {\npublic:\n    int recursion(int n, int cur)\n    {\n        // base\n        if (n == 0 || cur == 0) {\n            retu
**Method 1: RECURSION**\n```\nclass Solution {\npublic:\n    int recursion(int n, int cur)\n    {\n        // base\n        if (n == 0 || cur == 0) {\n            return 1;\n        }\n        // recurisve\n        if (cur > n) {\n            return recursion(n - 0, cur - 1);\n        }\n        else {\n            return max(recursion(n - 0, cur - 1), cur * recursion(n - cur, cur));\n        }\n    }\n    \n    int integerBreak(int n) \n    {\n        return recursion(n, n - 1);    \n    }\n};\n```\n\n**Method 2: DP MEMOIZATION**\n```\nclass Solution {\npublic:\n    int dp[58 + 1][57 + 1];\n    \n    int recursion(int n, int cur)\n    {    \n        if (n == 0 || cur == 0)\n            return 1;\n        if (dp[n][cur] != -1)\n            return dp[n][cur];\n        if (cur > n)\n            return dp[n][cur] = recursion(n - 0, cur - 1);\n        else\n            return dp[n][cur] = max(recursion(n - 0, cur - 1), cur * recursion(n - cur, cur));\n    }\n    \n    int integerBreak(int n) \n    {\n        memset(dp, -1, sizeof(dp));\n        return recursion(n, n - 1);    \n    }\n};\n```\n\n**Method 3: DP TABULATION**\n```\nclass Solution {\npublic:\n    int dp[58 + 1][57 + 1];\n    \n    int recursion(int n, int cur)\n    {\n        for (int i = 0; i < n + 1; i++) {\n            for (int j = 0; j < cur + 1; j++) {\n                if (i == 0 || j == 0) {\n                    dp[i][j] = 1;\n                }\n            }\n        }\n        \n        for (int i = 1; i < n + 1; i++) {\n            for (int j = 1; j < cur + 1; j++) {\n                if (i < j) {\n                    dp[i][j] = dp[i][j - 1];\n                }\n                else {\n                    dp[i][j] = max(dp[i][j - 1], j * dp[i - j][j]);\n                }\n            }\n        }\n        \n        return dp[n][cur];\n    }\n    \n    int integerBreak(int n) \n    {\n        memset(dp, -1, sizeof(dp));\n        return recursion(n, n - 1);    \n    }\n};\n```\n
['Dynamic Programming', 'Recursion', 'Memoization', 'C', 'C++']