摘要: 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. 1 public static string LongestPalindromicSubstring(string s) 2 { 3 if (s.Length <= 1) 4 ... 阅读全文
posted @ 2012-09-20 05:37 ETCOW 阅读(417) 评论(0) 推荐(0) 编辑
摘要: Write a function to find the longest common prefix string amongst an array of strings 1 public static string LongestCommonPrefix(List<string> strs) 2 { 3 if (strs.Count == 0) 4 return ""; 5 if (strs.Count == 1) 6 return strs[0];... 阅读全文
posted @ 2012-09-20 03:42 ETCOW 阅读(316) 评论(0) 推荐(0) 编辑
摘要: Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below.Input:Digit string "23"Output: ["ad", "ae", "af", "bd", "be", &q 阅读全文
posted @ 2012-09-20 03:29 ETCOW 阅读(448) 评论(0) 推荐(0) 编辑