Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without
repeating letters for "abcabcbb" is "abc", which the length is 3. Fo...
分类:
其他好文 时间:
2014-10-25 07:04:13
阅读次数:
208
Write a function to find the longest common prefix string amongst an array of strings.题目言简意赅,貌似也不难,暴力法用一个char *数组存放strs里每个元素的起始地址,然后循环,同时把所有指针向前移动,如果有...
分类:
其他好文 时间:
2014-10-25 00:52:44
阅读次数:
265
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ...
分类:
其他好文 时间:
2014-10-24 23:30:05
阅读次数:
260
如何获取JavaScript中Function的名字是一个很基本的问题。可以通过将function转化成字符串,用substring取它的名字,或者使用ECMAScript 6中的Function.name的支持。此属性只有在IE下有可能不兼容。详见MDN.关于从字符串中获得其名字的方法如下 (转自...
分类:
编程语言 时间:
2014-10-24 23:27:27
阅读次数:
416
首先看两个例子,通过subString方法获得字符串t,再通过t.charAt(3)方法获得字符串t的值中的第四个字符。[其中会利用反射机制,改变字符串s的值。](http://my.oschina.net/u/167082/blog/337066) 例子1: public c...
分类:
其他好文 时间:
2014-10-24 20:54:23
阅读次数:
252
MySQL数据库和SQLServer数据库的字符串截取函数比较MySQL字符串截取函数:SUBSTR(Stringstring,numstart,numlength)string是原字符串,start是起始位置(从1开始),length是截取字符串的长度;SQLServer字符串截取函数:SUBSTRING(Stringstring,numstart,numlength)string..
分类:
数据库 时间:
2014-10-24 19:04:06
阅读次数:
235
Given a string s, partition s such that every substring of the partition is a palindrome.
Return the minimum cuts needed for a palindrome partitioning of s.
For example, given s = "aab",
Return 1 s...
分类:
其他好文 时间:
2014-10-24 18:54:01
阅读次数:
111
C#经常用到的字符串的截取 在开发中我们经常需要截取字符串,很多初学者,不知道怎么做很好的截取字符串,下面是截取字符串过程中我们必须知道的以下函数:substring 函数、Remove 函数、indexOf函数. substring 函数 返回第一个参数中从第二个参数指定的位置开始、第三个参...
题目描述:
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 leaf node.
解题思路:直接DFS。
代码:
/**...
分类:
其他好文 时间:
2014-10-24 13:04:21
阅读次数:
147
$CurrentPath = $MyInvocation.MyCommand.Path.substring(0,$MyInvocation.MyCommand.Path.LastIndexOf('\')+1)$devcon = Join-Path $CurrentPath devcon.exe#使用...
分类:
其他好文 时间:
2014-10-23 18:55:19
阅读次数:
157