摘要: easy 阅读全文
posted @ 2018-08-30 12:08 jasoncool1 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 注意null的时候要单独判断 因为不能用val 阅读全文
posted @ 2018-08-28 22:16 jasoncool1 阅读(153) 评论(0) 推荐(0) 编辑
摘要: easy 阅读全文
posted @ 2018-08-28 22:01 jasoncool1 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 没啥特别 会longest palindromic substrings就可以 阅读全文
posted @ 2018-08-28 21:39 jasoncool1 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 把每个位置分成odd和even两种情况 两个指针分别向两边查找,看看最长的palindrome在哪里 这样复杂度比较低 全部遍历的话 timelimit exceed 阅读全文
posted @ 2018-08-28 21:05 jasoncool1 阅读(100) 评论(0) 推荐(0) 编辑
摘要: 用stack 阅读全文
posted @ 2018-08-28 07:43 jasoncool1 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 1 //easy 2 //注意字符串长度可能不一样 3 4 class Solution { 5 public boolean isAnagram(String s, String t) { 6 if(s.length() != t.length()) return false; 7 char[] arr1 = s.toCharArray(... 阅读全文
posted @ 2018-08-28 06:48 jasoncool1 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 自己方法复杂度比较高 可以O(n)的方法,遍历一遍 用两个指针记录maxstring的位置 然后遇到跟hashmap里重复的就更新指针https://leetcode.com/problems/longest-substring-without-repeating-characters/discus 阅读全文
posted @ 2018-08-28 06:37 jasoncool1 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 同Subset就是要先进行排序,backtrack的时候不要把重复的加入list 阅读全文
posted @ 2018-08-28 01:27 jasoncool1 阅读(121) 评论(0) 推荐(0) 编辑
摘要: backtrack的思想https://blog.csdn.net/wonner_/article/details/80373871这个链接很好 subset中的backtrack要把最后一个param设置成现在进行遍历的位置,而且backtrack中的循环要在上一个position之后开始 阅读全文
posted @ 2018-08-28 01:14 jasoncool1 阅读(154) 评论(0) 推荐(0) 编辑