摘要: Brutal Force: O(n^2) Manacher: O(n) 阅读全文
posted @ 2017-09-21 15:07 Weiyu Wang 阅读(146) 评论(0) 推荐(0)
摘要: public class Solution { public double findMedianSortedArrays(int[] nums1, int[] nums2) { int l=(nums1.length+nums2.length+1)>>1; int r=(nums1.length+nums2.length+2)>>1; re... 阅读全文
posted @ 2017-09-21 12:34 Weiyu Wang 阅读(152) 评论(0) 推荐(0)
摘要: class Solution { public int lengthOfLongestSubstring(String s) { Map map=new HashMap(); int maxlen=0; for(int j=0,i=0;i<s.length();i++) { char c=s.char... 阅读全文
posted @ 2017-09-21 05:52 Weiyu Wang 阅读(110) 评论(0) 推荐(0)
摘要: class Solution { public ListNode addTwoNumbers(ListNode l1, ListNode l2) { ListNode ret=new ListNode(0); ListNode l3=ret; int carry=0; while(l1!=null||l2!=null||ca... 阅读全文
posted @ 2017-09-21 05:39 Weiyu Wang 阅读(114) 评论(0) 推荐(0)