摘要:
动态方程:d[i][j] = (a[i]=a[j])&&d[i+1][j-1]public String longestPalindrome(String str) { if (str==null||str.length()==1) { return str; } int len = str.len 阅读全文
摘要:
public ListNode removeNthFromEnd(ListNode head, int n) { ListNode before = head; ListNode after = head; if(head==null){ return null; } while(n!=0){ be 阅读全文
摘要:
给定一个整数数组 nums 和一个整数目标值 target,请你在该数组中找出 和为目标值 target 的那 两个 整数,并返回它们的数组下标public int[] twoSum(int[] nums, int target) { int[] a = new int[2]; Map<Intege 阅读全文
摘要:
public ListNode addTwoNumbers(ListNode l1, ListNode l2) { ListNode res = new ListNode(); ListNode cur = res; int sum = 0; int carry = 0; while(l1!=nul 阅读全文