发布时间:2015-01-19 11:26:49
题目: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 for better legibility)P A H NA P L S I I GY I RAnd then read line by line: "PAHNAPLSIIGYIR"Write the co.........【阅读全文】
发布时间:2015-01-17 22:50:26
题目:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.最直观的解法,找出该字符串所有子字符串,依次判断该子字符串是否为回文字符串,之后再找出最长的子回文.........【阅读全文】
发布时间:2015-01-17 11:38:15
题目:You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list.Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)Output: 7 -> 0 -> 8解法:.........【阅读全文】