摘要: https://leetcode.com/problems/longest-palindromic-substring/manacher算法相关:http://blog.csdn.net/ywhorizen/article/details/6629268class Solution {public:... 阅读全文
posted @ 2015-09-01 20:03 雪溯 阅读(169) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/zigzag-conversion/The string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may... 阅读全文
posted @ 2015-09-01 20:01 雪溯 阅读(145) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/reverse-integer/class Solution {public: int inf = ~0u >> 1; int reverse(int x) { if(x == 0)return 0; ... 阅读全文
posted @ 2015-09-01 18:06 雪溯 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 思路:设现在可用区间在nums1是[s1,t1),nums2:[s2,t2)1.当一个数组可用区间为0的时候,由于另一个数组是已经排过序的,所以直接可得当要取的是最小值或最大值时,也直接可得2.明显两个数组总长度为偶数的时候需要取最中间两个元素/2.0,长度为奇数时,只需要求最中间那个.所以只需要分... 阅读全文
posted @ 2015-09-01 13:29 雪溯 阅读(190) 评论(0) 推荐(0) 编辑