字符串
TzyProgram
见证技术成长.C
展开
-
Leetcode_LongestSubstringWithoutRepeatingCharacters
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. Fo原创 2014-07-23 10:16:15 · 301 阅读 · 0 评论 -
Leetcode_Longest Palindromic Substring
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.原创 2014-07-23 10:03:01 · 283 阅读 · 0 评论 -
Leetcode_Zig Zag Conversion
string convert(string s, int nRows) { if(nRows == 1)return s; string ans = s; int k = 2*(nRows-1); int index = 0; for(int i = 0; i < nRows; ++i){ int increment = k - 2*i; int currentindex =原创 2014-07-24 05:17:16 · 413 阅读 · 0 评论