Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?根据回文串的特点,我们需要比较对应位置的值是否相等,那么我们首先需要找到...
分类:
其他好文 时间:
2015-09-08 12:22:57
阅读次数:
252
Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (i...
分类:
其他好文 时间:
2015-09-08 00:10:04
阅读次数:
178
Palindrome PermutationGiven a string, determine if a permutation of the string could form a palindrome.For example,"code"-> False,"aab"-> True,"carera...
分类:
其他好文 时间:
2015-09-06 12:50:23
阅读次数:
147
题目大意:RT分析:后缀数组求回文串,不得不说确实比较麻烦,尤其是再用线段数进行查询,需要注意的细节地方比较多,比赛实用性不高......不过练练手还是可以的。线段数+后缀数组代码如下:=========================================================...
分类:
其他好文 时间:
2015-09-05 11:09:32
阅读次数:
168
判断一个数字是否是回文数,尝试不用其他额外空间。注意:负数也有可能成为回文数吗?如果你想让int转为string,注意不用其他空间这个约束。你也可以翻转一个int,但是有可能会溢出。 1 public class Solution { 2 public boolean isPalindrom...
分类:
其他好文 时间:
2015-09-04 11:01:30
阅读次数:
127
leetcode刷题整理:1——Two Sum(哈希表hashtable,map)2——Add Two Numbers(链表)3——Longest Substring Without Repeating Characters(set,哈希表,两个指针)9——Palindrome Number (数学...
分类:
其他好文 时间:
2015-09-03 20:18:49
阅读次数:
190
Given a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n) time and O(1) space?Analyse: Obtain the elements first, ...
分类:
其他好文 时间:
2015-09-02 07:05:08
阅读次数:
162
Given a strings, partitionssuch that every substring of the partition is a palindrome.Return all possible palindrome partitioning ofs.For example, giv...
分类:
其他好文 时间:
2015-09-02 00:28:43
阅读次数:
214
Palindromic SquaresRob KolstadPalindromes are numbers that read the same forwards as backwards. The number 12321 is a typical palindrome.Given a numbe...
分类:
其他好文 时间:
2015-09-01 23:57:31
阅读次数:
347
Palindrome graphTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1727Accepted Submission(s): 525Pro...
分类:
其他好文 时间:
2015-09-01 01:35:35
阅读次数:
199