题意: 给定一棵树,任意选定两个节点(也可以是同一个节点),使这两个点和连接这两个点的路径上的点中最大值和最小值小于d 题解: 依次选定每一个节点并假设它是根节点(这棵树不一定是二叉树),同时假定根节点的值最大。从根节点开始遍历子节点,每一个子节点要满足以下性质: 子节点的值 ...
分类:
其他好文 时间:
2018-03-01 00:36:44
阅读次数:
107
Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results. Note: The input string may cont ...
分类:
其他好文 时间:
2018-02-28 10:36:39
阅读次数:
164
1. is_valid如果返回值如果为真 证明验证成功 意味着self.is_bound为True 和 self.errors为False def is_valid(self): return self.is_bound and not self.errors 1).那么self.is_bound什... ...
分类:
其他好文 时间:
2018-02-27 21:16:56
阅读次数:
189
题目:Given a linked list, remove the nth node from the end of list and return its head. For example, Note:Given n will always be valid.Try to do this in ...
分类:
编程语言 时间:
2018-02-27 16:02:34
阅读次数:
157
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the lo ...
分类:
其他好文 时间:
2018-02-25 19:13:20
阅读次数:
143
Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another e ...
分类:
其他好文 时间:
2018-02-25 19:06:11
阅读次数:
175
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. Given a string containing just ...
分类:
其他好文 时间:
2018-02-25 17:33:08
阅读次数:
166
一、Form基本使用 类 字段 is_valid() cleaned_data errors 字段参数: max_length min_length validators = [RegexValidators("xxx")] 钩子函数 clean_字段名 注意: 必须有返回值 只能拿自己当前字段值 ...
分类:
其他好文 时间:
2018-02-21 11:38:15
阅读次数:
392
.field-validation-error { color: #f00; } .field-validation-valid { display: none; } .input-validation-error { border: 1px solid #f00; background-color ...
分类:
Web程序 时间:
2018-02-19 19:20:12
阅读次数:
217
Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example,"A man, a plan, a canal: Pan ...
分类:
其他好文 时间:
2018-02-18 16:20:39
阅读次数:
160