Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.
Return all such possible sentences.
For example, given
s = "...
分类:
其他好文 时间:
2015-04-07 10:09:29
阅读次数:
91
【题目】
Given a string containing just the characters '(' and ')',
find the length of the longest valid (well-formed) parentheses substring.
For "(()", the longest valid parentheses substring i...
分类:
其他好文 时间:
2015-04-06 20:21:52
阅读次数:
113
昨天写的Sudoku游戏需要增加计时器功能,使用Chronometer实现如下,由于Chronometer自己在调用stop之后后台的计时器还会继续增加,所以暂停功能需要额外实现:在StartActivity onCreate方法中添加如下代码:textView = (TextView) findV...
分类:
移动开发 时间:
2015-04-05 23:21:57
阅读次数:
241
https://leetcode.com/problems/longest-valid-parentheses/Given a string containing just the characters'('and')', find the length of the longest valid (...
分类:
其他好文 时间:
2015-04-05 21:38:33
阅读次数:
136
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana...
分类:
其他好文 时间:
2015-04-05 17:20:10
阅读次数:
97
给出一个数独的一部分,然后然后要我们填完整这个数独。Input本题包含多组测试,每组之间由一个空行隔开。每组测试会给你一个 9*9 的矩阵,同一行相邻的两个元素用一个空格分开。其中1-9代表该位置的已经填好的数,问号(?)表示需要你填的数。Output对于每组测试,请输出它的解,同一行相邻的两个数用...
分类:
其他好文 时间:
2015-04-04 14:53:43
阅读次数:
226
题目链接:restore-ip-addresses
import java.util.ArrayList;
import java.util.List;
/**
*
Given a string containing only digits,
restore it by returning all possible valid IP address combination...
分类:
其他好文 时间:
2015-04-04 09:14:43
阅读次数:
113
一:什么是迭代器通过某种统一的方式遍历链表或者数组中的元素的过程叫做迭代遍历,这种统一的遍历工具我们叫做迭代器。二:ArrayIterator迭代器1:Iterator接口PHP中的迭代器是通过Iterator接口定义的。包括current()、key()、next()、rewind()、valid...
分类:
其他好文 时间:
2015-04-03 19:11:52
阅读次数:
195
题目链接:valid-number
/**
*
Validate if a given string is numeric.
Some examples:
"0" => true
" 0.1 " => true
"abc" => false
"1 a" => false
"2e10" => true
Note: It is intended for the pro...
分类:
其他好文 时间:
2015-04-03 15:28:08
阅读次数:
137
判断是不是符合数独的规则。数独的规则:每一行每一列不能有重复的数字,每一个3X3方格中不能有重复的数字,但是这个题中可以为空即都是'.'。 (要养成良好的编程习惯啊,要不一点低级错误不容易发现,浪费生命!)public class Solution { public boolean isVal...
分类:
其他好文 时间:
2015-04-03 15:09:54
阅读次数:
124