摘要:
public int minCut(String s) { int n = s.length(); int[] f = new int[n+1]; boolean[][] p = new boolean[n][n]; for (int i = 0;i<= n;i++){ f[i] = n-1-i; 阅读全文
摘要:
动态规划好巧妙啊啊啊啊啊啊啊 啊 int max =Integer.MIN_VALUE; public int maxPathSum(TreeNode root) { //用动态规划来求解 //DFS //根节点的值、左子树的值、右子树的值、 dfs(root); return max; } pri 阅读全文
摘要:
class Solution { //定义一个数组,用于存放每一列的皇后放置的位置 List<List<String>> result = new ArrayList<>(); public List<List<String>> solveNQueens(int n) { //N皇后 int[] c 阅读全文