LeetCode 之 Valid Palindrome,本文给出详细算法思想与源码实现。...
分类:
其他好文 时间:
2015-07-23 10:43:50
阅读次数:
129
SUBSTRING函数作用:截取字符串语法:SUBSTRING(字符串,开始位置,结束位置)示例:SELECTSUBSTRING(‘床前明月光疑是地上霜‘,3,5)结果:明月光疑是CHARINDEX函数作用:查找字符串的起始位置语法:CHARINDEX(需查找的字符串,字符串[,起始位置])如果没有录入起始位置则默认从第一个..
分类:
其他好文 时间:
2015-07-23 00:58:21
阅读次数:
211
Given a string,find the length of the longest substring without repeating characters. Forexample, the longest substring without repeating letters for"abcabcbb" is "abc", which the length is 3. For"bbb...
分类:
其他好文 时间:
2015-07-21 12:54:53
阅读次数:
84
076 Minimum Window Substring这道题就是用一个dictionary来跟踪有多少还需要Match的字母以及当前需要match的次数。 再用一个queue 来记录哪些字幕被Match了以及他们被match的顺序from collections import defaultdic...
Longest Prefix给定一堆小字符串,问最长可以组成给定的大字符串的多少位前缀。类似于DP的思想,标记出结束位置。看最远结束在哪里。#include using namespace std;const int N = 1205;const int M = 200004;string ch.....
分类:
其他好文 时间:
2015-07-21 06:42:05
阅读次数:
94
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...
分类:
其他好文 时间:
2015-07-20 23:00:05
阅读次数:
85
DescriptionThere is a sequence of integers. Your task is to find the longest subsequence that satisfies the following condition: the difference betwee...
分类:
其他好文 时间:
2015-07-20 12:21:06
阅读次数:
82
【014-Longest Common Prefix(最长公共前缀)】【LeetCode-面试算法经典-Java实现】【所有题目目录索引】原题 Write a function to find the longest common prefix string amongst an array of strings.
题目大意 写一个函数找出一个字串所数组中的最长的公共前缀。
解题思路 第一...
分类:
编程语言 时间:
2015-07-20 09:18:51
阅读次数:
183
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 = "ADOBECODEBANC"
T = "ABC"
Minimum window is "BAN...
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-07-19 10:00:25
阅读次数:
125