
字符串
文章平均质量分 71
chuandalishuo
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
3. Longest Substring Without Repeating Characters
class Solution(object): def lengthOfLongestSubstring(self, s): """ :type s: str :rtype: int """ repeatChar={} maxLen=0 left=0 right=0 for curChar in s: if repeatChar.has_key(curChar): maxLen = max(max原创 2016-02-01 11:25:49 · 240 阅读 · 0 评论 -
6. ZigZag Conversion
1. Java In-place solution: public class Solution { public String convert(String s, int numRows) { if(numRows=s.length()) return s; StringBuilder sb = new StringBuilder();原创 2016-03-02 15:40:48 · 218 阅读 · 0 评论 -
28. Implement strStr() [easy]
Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. Java public class Solution { public int strStr(String haystac原创 2016-06-09 13:18:06 · 253 阅读 · 0 评论 -
165. Compare Version Numbers
题目: Compare two version numbers version1 and version2. If version1 > version2 return 1, if version1 version2 return -1, otherwise return 0. You may assume that the version strings are non-empty原创 2016-09-21 14:08:43 · 184 阅读 · 0 评论 -
189. Rotate Array
Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4]. Try to come up as many solutions as you can,原创 2016-10-14 09:11:08 · 184 阅读 · 0 评论 -
30. Substring with Concatenation of All Words
You are given a string, s, and a list of words, words, that are all of the same length. Find all starting indices of substring(s) in s that is a concatenation of each word in words exactly once and原创 2016-11-01 15:15:46 · 183 阅读 · 0 评论 -
394. Decode String
Given an encoded string, return it's decoded string. The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note that k is原创 2016-11-17 02:28:29 · 200 阅读 · 0 评论