第九章 动态规划part17 647. 回文子串 class Solution {public int countSubstrings(String s) {char[] chars = s.toCharArray();int len = chars.length;boolean[][] dp = new boolean[len][len];int result = 0;for (int
第九章 动态规划part12 309.最佳买卖股票时机含冷冻期 class Solution {public int maxProfit(int[] prices) {//0代表持股票,1代表保持卖出状态,2代表卖出股票。3代表冷冻int[][] dp = new int[prices.length][4];dp[0][0] = -prices[0];for(int i = 1 ; i
93.复原IP地址 class Solution {List<String> result = new ArrayList<>();public List<String> restoreIpAddresses(String s) {StringBuilder sb = new StringBuilder(s);backTracking(sb, 0, 0);return result;}pr