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 ...
分类:
其他好文 时间:
2018-12-31 10:25:06
阅读次数:
143
Field.clean(value)[source] 虽然表单字段的Field类主要使用在Form类中,但也可以直接实例化它们来使用,以便更好地了解它们是如何工作的。每个Field的实例都有一个clean()方法,它接受一个参数,然后返回“清洁的”数据或者抛出一个django.forms.Valid ...
分类:
其他好文 时间:
2018-12-30 20:19:33
阅读次数:
169
Given a balanced parentheses string S, compute the score of the string based on the following rule: () has score 1 AB has score A + B, where A and B a ...
分类:
其他好文 时间:
2018-12-28 22:11:08
阅读次数:
243
这是悦乐书的第 209 次更新,第 221 篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第77题(顺位题号是367)。给定正整数num,写一个函数,如果num是一个完美的正方形,则返回True,否则返回False。例如: 输入:16 输出:true 输入:14 输出: ...
分类:
编程语言 时间:
2018-12-22 20:35:51
阅读次数:
194
转自:https://www.cnblogs.com/chonghaojie/p/9994625.html 客户端:select * from sys.nls_session_parameters;服务端:select * from sys.nls_database_parameters; 执行脚本 ...
分类:
数据库 时间:
2018-12-20 17:01:13
阅读次数:
177
注意这两个元素不能是相同的。 解法一:二分查找法,逐一取数组中的值,然后second = target - numbers[i] , 用二分查找法求第二个值。 时间复杂度:O(nlongn) 解法三:对撞指针 使用两个指针,若nums[i] + nums[j] > target 时,i++; 若nu ...
分类:
其他好文 时间:
2018-12-19 23:25:16
阅读次数:
211
今天在以前的一台虚拟机做ssh隧道实验的时候yum 安装telnet的时候出现了Cannot find a valid baseurl for repo:base,ping物理机192.168.1.1没问题,尝试过更改/etc/resolv.conf里namesever8.8.8.8,没用,后来对比 ...
分类:
其他好文 时间:
2018-12-19 15:42:44
阅读次数:
239
将例二改写成面向对象模式,并加了环境! 不过更新环境的过程中,用到了清屏命令,play()的时候,会有点问题。learn()的时候可以勉强看到:P 0.效果图 1.完整代码 相对于例一,修改的地方: Agent 五处:states, actions, rewards, get_valid_actio ...
分类:
编程语言 时间:
2018-12-18 21:47:59
阅读次数:
268
很无聊的一道题目歧义也很多 判断一个字符串是否能够用十进制数表示,下面是一堆范例 "0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => true" -90e3 " => true" 1e" => fals ...
分类:
其他好文 时间:
2018-12-18 19:48:24
阅读次数:
131
Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. Example 1: Input: "aba" Output: True Exa ...
分类:
其他好文 时间:
2018-12-18 11:02:53
阅读次数:
180