Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, givens = "leetcode",dict = ["leet", "code"...
分类:
其他好文 时间:
2015-01-23 13:21:09
阅读次数:
131
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.
For example, given
s = "leetcode",
dict = ["leet"...
分类:
其他好文 时间:
2014-12-25 22:07:37
阅读次数:
330
leet code -- Divide Two Integers...
分类:
其他好文 时间:
2014-12-17 14:42:55
阅读次数:
188
给一个字符串,判断是否能够分为若干个部分,并且每个部分都能在字典dict里面找到。有的话就返回true。例如:For example, givens="leetcode",dict=["leet", "code"].Return true because"leetcode"can be segmen...
分类:
其他好文 时间:
2014-12-12 16:31:11
阅读次数:
180
在leet code上做题遇到了一个坑,算法总认为自己写得没有问题,处理流程造就烂熟于心,用X code调试发现还是疏忽了:C++返回引用和返回对象的差别,在一个函数结束的地方返回了一个临时对象的引用! 根据以往的经验,引用是C++程序中高效能的法宝,节省了对象复制拷贝时的开销,但是滥用引用也...
分类:
其他好文 时间:
2014-12-07 21:36:41
阅读次数:
185
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. For ...
分类:
其他好文 时间:
2014-10-30 11:46:27
阅读次数:
188
Given two binary strings, return their sum (also a binary string).
For example,
a = "11"
b = "1"
Return "100".
实现二进制数相加,算法很简单就是两个String每位去相加,然后判断是否要进位。
一开始想到了一个不同的算法,即将两个String转为int型然后相加...
分类:
其他好文 时间:
2014-10-28 13:59:50
阅读次数:
237
Palindrome NumberTotal Accepted:19369Total Submissions:66673My SubmissionsDetermine whether an integer is a palindrome. Do this without extra space.推断...
分类:
其他好文 时间:
2014-09-25 14:43:19
阅读次数:
137
Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.
For example, given
s = "leetcode",
dict = ["leet"...
分类:
其他好文 时间:
2014-09-22 12:40:12
阅读次数:
184