//从数据库TinyDB1中读出"nameList"列的值并赋值给列表变量nameList,如果数据库中不存在"nameList"列,则将空列表赋值给nameList变量。//判断nameList变量是否为空,如果不为空,则遍历每一个元素,并输出。//segment相当于subString()函数,...
分类:
数据库 时间:
2014-07-29 11:34:46
阅读次数:
517
1 public class Solution { 2 public static int lengthOfLongestSubstring(String s) { 3 4 char[] arr = s.toCharArray(); 5 int pre = 0; 6 ...
Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s.For example,...
分类:
其他好文 时间:
2014-07-28 19:17:14
阅读次数:
245
Similar with "Longest Consecutive Sequence". Another usage to hashset.Take care of corner cases!class Solution {public: int firstMissingPositive(in...
分类:
其他好文 时间:
2014-07-28 15:16:43
阅读次数:
206
题目:Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).For example,S = "ADOBE....
分类:
编程语言 时间:
2014-07-28 14:42:23
阅读次数:
264
题目:You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a conca....
分类:
编程语言 时间:
2014-07-28 14:39:03
阅读次数:
1117
题目:Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letter....
分类:
编程语言 时间:
2014-07-28 11:34:30
阅读次数:
265
题目:Write a function to find the longest common prefix string amongst an array of strings.题解:解题思路是,先对整个String数组预处理一下,求一个最小长度(最长前缀肯定不能大于最小长度)。然后以第0个字符串....
分类:
编程语言 时间:
2014-07-28 11:33:30
阅读次数:
241
周末女朋友不在家,打算做几题LeetCode的题目练练手,Pick One,随机抽中Palindrome Partitioning,题目如下: Given a strings, partitionssuch that every substring of the partition is a ...
分类:
其他好文 时间:
2014-07-28 11:32:20
阅读次数:
417
Palindrome Partitioning II
Total Accepted: 11791 Total
Submissions: 66110My Submissions
Given a string s, partition s such that every substring of the partition is a palindrome.
Return t...
分类:
其他好文 时间:
2014-07-27 23:59:19
阅读次数:
592