select a.pluno,a.pluname,a.spec,a.qty,d.qty,e.qty,a.dptno,substring(a.dptno,1,3),f.dptname,substring(a.dptno,1,4),g.dptname,substring(a.dptno,1,5),h.d...
分类:
其他好文 时间:
2014-09-14 15:16:07
阅读次数:
225
记录最大的起始位置+hash
int lengthOfLongestSubstring(string s) {
map charMap;
int curLen, maxLen = 0,lastIndex = -1;
for (int i = 0; i < s.size(); i++)
{
if (charMa...
分类:
其他好文 时间:
2014-09-14 12:53:27
阅读次数:
158
实现了两种方法,一种是DP,用循环做的,递归的话更简单。
string longestPalindrome(string s) {
int n = s.size();
bool dp[1001][1001];
int maxl = 1;
int maxs = 0;
for (int i = n - 1; i >= 0...
分类:
其他好文 时间:
2014-09-14 12:53:07
阅读次数:
190
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...
分类:
其他好文 时间:
2014-09-14 12:49:37
阅读次数:
214
The xor-longest PathTime Limit:2000MSMemory Limit:65536KTotal Submissions:3875Accepted:850DescriptionIn an edge-weighted tree, the xor-length of a pat...
分类:
其他好文 时间:
2014-09-13 23:59:06
阅读次数:
434
Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest le...
分类:
其他好文 时间:
2014-09-13 20:08:35
阅读次数:
179
HashMap 在leetcode Longest Consecutive Sequence 上巧妙使用。...
分类:
其他好文 时间:
2014-09-13 15:57:45
阅读次数:
144
在论坛中看到一个帖子,帖子中有一些sql方面的面试题,我觉得这些面试题很有代表性。
下面是我的解法,供大家参考:
--1.拆分字符串
create table test1 (number varchar(100))
insert into test1 values ('1,2,3,4,5,6')
select --t.number,
SUBSTRING(t.n...
分类:
数据库 时间:
2014-09-13 13:24:45
阅读次数:
276
[leetcode]Longest Common Prefix...
分类:
其他好文 时间:
2014-09-13 10:39:35
阅读次数:
173
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 concatenation of each word in L exactly once and without an...
分类:
其他好文 时间:
2014-09-13 09:27:24
阅读次数:
202