Open underwindfall opened 2 years ago
https://leetcode-cn.com/problems/jian-sheng-zi-lcof/
思路
[ ] 刷15mins
[ ] 刷5mins
// time O(n^2) // space O(n) public int integerBreak(int n) { int[] dp = new int[n + 1]; for (int i = 2; i <= n; i++) { int currMax = 0; for (int j = 1; j < i; j++) { currMax = Math.max(currMax, Math.max(j * (i - j), j * dp[i - j])); } dp[i] = currMax; } return dp[n]; }
https://leetcode-cn.com/problems/jian-sheng-zi-lcof/
思路
[ ] 刷15mins
[ ] 刷5mins