Given a stringS, find the longest palindromic substring inS. You may assume that the maximum length ofSis 1000, and there exists one unique longest pa...
分类:
其他好文 时间:
2015-09-07 22:51:12
阅读次数:
227
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters fo...
分类:
其他好文 时间:
2015-09-07 22:50:00
阅读次数:
213
【题目】LeetCode(5): Longest Palindromic SubstringURL: https://leetcode.com/problems/longest-palindromic-substring/【描述】Given a stringS, find the longest p...
分类:
其他好文 时间:
2015-09-07 07:02:02
阅读次数:
339
1350 - Trie时间限制:1秒内存限制:128兆104 次提交 35 次通过题目描述In computer science, a trie, is an ordered tree data structure that is used to store an associative array...
分类:
其他好文 时间:
2015-09-06 17:35:10
阅读次数:
235
Longest Substring with At Most Two Distinct CharactersGiven a string, find the length of the longest substring T that contains at most 2 distinct char...
分类:
其他好文 时间:
2015-09-06 12:38:14
阅读次数:
178
今天学业习了上下文界定的内容,看下这段代码class Pair_Ordering[T:Ordering](val first : T,val second : T){ def bigger(implicit ordered:Ordering[T]) = { if(ordered.compare(fi...
分类:
其他好文 时间:
2015-09-06 01:05:42
阅读次数:
179
1.命令文件/函数文件+函数文件:多个M文件2.函数文件+子函数:一个M文件3. inline:无需M文件4.符号表达式+subs方式:无需M文件5.字符串+subs方式:无需M文件第一种:命令文件/函数文件+函数文件%命令/函数文件:myfile1.mclearfor t=1:10 y=mylf....
分类:
其他好文 时间:
2015-09-05 23:34:44
阅读次数:
216
找最长公共前缀,Longest Common Prefix,自己写的小算法,并吸取他人的精华进行改进,直接上代码,第一次写难免会有疏漏,还望大家指正 #include<iostream>
#include<string>
#include<vector>
using?namespace...
分类:
其他好文 时间:
2015-09-05 18:01:36
阅读次数:
153
1 class Solution { 2 public: 3 4 int lengthOfLongestSubstring(string s) { 5 // for ASCII char sequence, use this as a hashmap 6 vector...
分类:
其他好文 时间:
2015-09-05 12:17:57
阅读次数:
127
题意是给出一些子串,用这些子串能拼出一个S的前缀来,问这个前缀最长能有多长。做法是,从S的第一个元素开始扫,到S[i]时,查看每一个长度不大于i的子串,然后检查这个子串能否和以i为结尾,长度与这个子串长度相同的S的子串匹配,若能匹配,则检查在以S[i-子串长度] 为结尾处能否找到以前匹配到S[i-子...
分类:
其他好文 时间:
2015-09-04 17:00:46
阅读次数:
203