- 博客(7)
- 收藏
- 关注
原创 LeetCode-005-最长回文子串
题目: 解答1: class Solution { public String longestPalindrome(String s) { int length = s.length(); if(length==0) return ""; char alpha[] = new char[length]; alpha = s.toChar...
2019-06-17 18:00:24
87
原创 LeetCode-004-寻找两个有序数组的中位数
题目: 解答: class Solution { public double findMedianSortedArrays(int[] nums1, int[] nums2) { int len1=nums1.length,len2=nums2.length; int[] newNums = new int[(len1+len2)/2+...
2019-06-17 17:56:52
84
原创 LeetCode-003-无重复字符的最长子串
题目: 解答: class Solution { public int lengthOfLongestSubstring(String s) { int count =0,len=s.length(); if(len<=1) return len; char[] alphabet = new char[len]; for(int...
2019-06-16 21:00:39
81
原创 LeetCode-002-两数相加
题目: 解答: /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode(int x) { val = x; } * } */ class Solution { public ListNod...
2019-06-15 22:01:54
71
原创 LeetCode-001-两数之和
题目: 解答: class Solution { public int[] twoSum(int[] nums, int target) { if(nums==null || nums.length==0) { throw new RuntimeException("nums is blank"); ...
2019-06-15 20:50:17
144
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人