摘要:
Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below 阅读全文
摘要:
Given a 32-bit signed integer, reverse digits of an integer. Example 1: Example 2: Example 3: Note:Assume we are dealing with an environment which cou 阅读全文
摘要:
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font 阅读全文
摘要:
Manacher's Algorithm针对的是最长回文子串问题。对于此问题,最直接的方法是遍历每一个元素,遍历过程中以每一个字符为中心向两边扩展以寻找此字符为中心的最长回文子串。复杂度O(n2)。Manacher算法将时间复杂度降至O(n),关键点在于将奇偶字串统一成奇数字串。 方法是在每一个字符 阅读全文