Given a string containing only digits, restore it by returning all possible valid IP address combinations.
For example: Given "25525511135",
return ["255.255.11.135", "255.255.111.35"]. (Order does ...
分类:
其他好文 时间:
2015-04-20 14:53:39
阅读次数:
95
Valid ParenthesesTotal Accepted:47887Total Submissions:180550My SubmissionsQuestionSolutionGiven a string containing just the characters'(',')','{','}...
分类:
其他好文 时间:
2015-04-20 12:59:20
阅读次数:
85
1. Valid Parentheses
用来判断字符串中的括号是否合法的一道题。注意输入只会有 (, ) , {, }, [, ]这么几种情况。
合法的括号是以一定的顺序进行匹配的一些。比如:"()[]', 或者"([])"等,而以"([)]"这种为类型的表示是有错误的。
很显然用“stack”来作为数据结构来实现这道题,每一次插入一个元素的时候都进行匹配,如果匹配成功了,那么就将栈顶元素...
分类:
编程语言 时间:
2015-04-20 11:14:24
阅读次数:
138
情况1:#ifdef _DEBUGvirtual void AssertValid() const; //assert(断言)valid(有效的,正确的)virtual void Dump(CDumpContext& dc) const; //存储上下文#endif 这两个函数是调试用的,第一个函数...
分类:
其他好文 时间:
2015-04-19 17:34:44
阅读次数:
163
思路:前后两个指针。又一次bug free!(但是速度慢。待我想想有什么更好解法么?或者是 判断可以优化?果真!判断isCharEqual(c1,c2)时,可以优化。不需要判断c1到底是大写还是小写)如下面。 bool isCharEqual(char c1, char c2){ ...
分类:
其他好文 时间:
2015-04-19 14:32:58
阅读次数:
111
这个解法告诉我们读题要精确,且例证了多维数组的重要性。# Sudoku [http://en.wikipedia.org/wiki/Sudoku]# A valid sudoku square satisfies these# two properties:# 1. Each column of.....
分类:
其他好文 时间:
2015-04-18 13:03:41
阅读次数:
124
环境:ubuntu14.04程序:docker1.6下载镜像报错:#dockerpullcentos:centos5PullingrepositorycentosFATA[0004]Gethttps://index.docker.io/v1/repositories/library/centos/p_w_picpaths:x509:certificatehasexpiredorisnotyetvalid这种错误,一般都是本地系统时间错误导致报..
分类:
其他好文 时间:
2015-04-17 18:29:07
阅读次数:
168
problem:
Given a binary tree, determine if it is a valid binary search tree (BST).
Assume a BST is defined as follows:
The left subtree of a node contains only nodes with keys less th...
分类:
其他好文 时间:
2015-04-17 18:28:13
阅读次数:
142
题目:Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the long...
分类:
其他好文 时间:
2015-04-17 17:52:17
阅读次数:
118
真机调试时,build settings 里面Provisioning Profile的releases选Distribution证书会提示A valid provisioning profile for this executable was not found。使用发布证书进行编译,运行在真机上时会提示该信息Distribution 的profile是分Adhoc和App store两种,adh...
分类:
其他好文 时间:
2015-04-17 14:00:45
阅读次数:
96