摘要:
原题链接:https://leetcode-cn.com/problems/minimum-path-sum/ class Solution { // 动态规划的问题 // dp[i][j] 值表示 i,j 位置到 最右下角的最小数字和 public int minPathSum(int[][] g 阅读全文
摘要:
原题链接:https://leetcode-cn.com/problems/maximum-subarray/ class Solution { // 动态规划 public int maxSubArray(int[] nums) { // 记录当前为位置的前一个位置已经得到的最大值 int pre 阅读全文
摘要:
原题链接:https://leetcode-cn.com/problems/merge-two-sorted-lists/ /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode 阅读全文
摘要:
原题链接:https://leetcode-cn.com/problems/coin-change/ class Solution { public int coinChange(int[] coins, int amount) { int[] dp = new int[amount + 1]; / 阅读全文
摘要:
来源:https://www.cnblogs.com/taochen-go/p/9475947.html 【内存图画的很好】 String s = new String(“hello”)和String s = “hello”; String s = new String(“hello”)会创建2(1 阅读全文
摘要:
题目链接:https://leetcode-cn.com/problems/binary-tree-inorder-traversal/ /** * Definition for a binary tree node. * public class TreeNode { * int val; * T 阅读全文
摘要:
原题链接:https://leetcode-cn.com/problems/longest-substring-without-repeating-characters/ class Solution { public int lengthOfLongestSubstring(String s) { 阅读全文