随笔分类 -  LeetCode

摘要:01背包 三维!- i w 01 记忆化递归 , 从n-1号开始,考虑与不考虑 public int bestValue(int[] w,int[] v,int n,int c){ //尝试用 n号物品 填充 c的背包 记忆化nc即可。 if(n<0 || c<=0){ return 0; }els 阅读全文
posted @ 2021-01-07 11:26 逆风微笑的魔法师 阅读(61) 评论(0) 推荐(0)
摘要:记 无重复字符的最长子串 首先:写了2小时写出来的垃圾算法 public static int lengthOfLongestSubstring(String s) { char t[] = s.toCharArray(); int count = 0; int max =0; Map<Intege 阅读全文
posted @ 2019-12-28 01:00 逆风微笑的魔法师 阅读(90) 评论(0) 推荐(0)