摘要:
public class Solution { public int reverse(int x) { //此题需要注意整数越界问题,因此先将res声明为long,注意32位的范围是0x80000000到0x7fffffff long res=0; i... 阅读全文
posted @ 2015-07-04 22:51
~每天进步一点点~
阅读(134)
评论(0)
推荐(0)
摘要:
public class Solution { public String convert(String s, int numRows) { //本题通过画图numRows=4和numRows=5可以得到规则,主线路距离是2*numRows-2;辅助行是(numRows-i-1)... 阅读全文
posted @ 2015-07-04 22:26
~每天进步一点点~
阅读(139)
评论(0)
推荐(0)
摘要:
public class Solution { public String longestPalindrome(String s) { //本题是动态规划思想,构造一个数组pal[i][j],表示从i到j是否为一个回文, //pal[i][j]=true;if i=... 阅读全文
posted @ 2015-07-04 21:40
~每天进步一点点~
阅读(141)
评论(0)
推荐(0)
摘要:
There are two sorted arraysnums1andnums2of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should... 阅读全文
posted @ 2015-07-04 16:09
~每天进步一点点~
阅读(165)
评论(0)
推荐(0)
摘要:
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo... 阅读全文
posted @ 2015-07-04 14:03
~每天进步一点点~
阅读(127)
评论(0)
推荐(0)
浙公网安备 33010602011771号