上一页 1 ··· 3 4 5 6 7 8 9 10 11 12 下一页
摘要: public static int reverse(int x) { if(x==0){ return 0; } if(x>(Math.pow(2, 31))-1 || x(Math.pow(2, 31))-1 || sum<(-1*Math.pow(2, 31))){ return 0; ... 阅读全文
posted @ 2019-05-05 21:31 紫色的雪 阅读(1989) 评论(0) 推荐(0)
摘要: /** public class TreeNode { int val = 0; TreeNode left = null; TreeNode right = null; public TreeNode(int val) { this.val = val; } } */ public class Solution { publ... 阅读全文
posted @ 2019-05-05 20:58 紫色的雪 阅读(474) 评论(0) 推荐(0)
摘要: public String convert(String s, int numRows) { if(numRows <= 1){ return s; } StringBuilder[] sb = new StringBuilder[numRows]; for(int i = 0; i < sb.length;... 阅读全文
posted @ 2019-04-27 11:17 紫色的雪 阅读(1376) 评论(0) 推荐(0)
摘要: public String longestPalindrome(String s) { if(s == null||s.length()==0){ return s; } String res = ""; int max=0; boolean[][] dp = new boolean[s.l... 阅读全文
posted @ 2019-04-24 23:12 紫色的雪 阅读(1337) 评论(0) 推荐(0)
摘要: public double findMedianSortedArrays(int[] nums1, int[] nums2) { if(nums1.length > nums2.length){ return findMedianSortedArrays(nums2, nums1); } int cut1=0; ... 阅读全文
posted @ 2019-04-24 11:18 紫色的雪 阅读(2601) 评论(0) 推荐(0)
摘要: public int lengthOfLongestSubstring(String s) { if(s.length()==0||s==null){ return 0; } int len=0; HashSet hashSet = new HashSet(); for(int i=0,j=0... 阅读全文
posted @ 2019-04-22 20:45 紫色的雪 阅读(832) 评论(0) 推荐(0)
摘要: /* public class RandomListNode { int label; RandomListNode next = null; RandomListNode random = null; RandomListNode(int label) { this.label = label; } } */ /** * 根据每个节点n... 阅读全文
posted @ 2019-04-21 16:45 紫色的雪 阅读(346) 评论(0) 推荐(0)
摘要: import java.util.ArrayList; import java.util.Stack; /** public class TreeNode { int val = 0; TreeNode left = null; TreeNode right = null; public TreeNode(int val) { this.val ... 阅读全文
posted @ 2019-04-17 21:47 紫色的雪 阅读(521) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 12 下一页