$\text$我来啦我来啦 \(\text{Solution:}\) 题目要求求好几个串串的$\text$ 由于串串的数量并不多,所以我们把它们塞到一个$\text$里面,中间加上分隔符号。 那么答案就是最深的且它的子树中具有所有分节符的非叶子节点。 至于分节符数量和种类,用前缀和即可。 介于$\t ...
分类:
其他好文 时间:
2020-06-26 14:56:32
阅读次数:
46
7-3 Is It An AVL Tree (25分) In computer science, an AVL tree (Georgy Adelson-Velsky and Evgenii Landis' tree, named after the inventors) is a self-bal ...
分类:
其他好文 时间:
2020-06-26 14:44:26
阅读次数:
84
python的 if-else 有很多简洁的写法,下面一一介绍。 1. 普通写法 # a 和 b 中的较大数赋值给 c a, b, c = 1, 2, 3 if a > b: c = a else: c = b print(c) 2. if ... else 一行表达式 """ 当if为真时,var ...
分类:
其他好文 时间:
2020-06-26 11:06:45
阅读次数:
49
题目描述: 提交: class Solution: from typing import List def avoidFlood(self, rains: List[int]) -> List[int]: import heapq heap = [] res = [-1 if i != 0 else ...
分类:
其他好文 时间:
2020-06-26 11:00:34
阅读次数:
70
Given a sorted array A of unique numbers, find the K-th missing number starting from the leftmost number of the array. Example 1: Input: A = [4,7,9,10 ...
分类:
其他好文 时间:
2020-06-26 10:52:26
阅读次数:
72
其中有四个知识点我单独罗列了出来,属于多线程编程中需要知道的知识: 知识点1:X,T为泛型,为什么要用泛型,泛型和Object的区别请看:https://www.cnblogs.com/xiaoxiong2015/p/12705815.html 知识点2:线程池:https://www.cnblog ...
分类:
编程语言 时间:
2020-06-25 23:44:55
阅读次数:
111
链接:https://leetcode-cn.com/problems/longest-valid-parentheses/ 思路 将整个序列分段,即刚刚不满足左括号数量大于等于右括号数量条件的情况;则任何一个合法序列在每个段内。 使用栈来存储位置。 代码 class Solution { publ ...
分类:
其他好文 时间:
2020-06-25 23:22:59
阅读次数:
45
比较大小 #!/bin/bash num1=100 num2=200 if(($num1>$num2));then //比较大小(( )),使用双括号 echo '>' echo "\$num1:$num1 > \$num2:$num2" else echo '<=' echo "\$num1:$n ...
分类:
其他好文 时间:
2020-06-25 21:50:46
阅读次数:
78
1.语法格式 1.1 最基本的格式 if [ condition ];then 符合if时执行的语句 fi 1.2 扩展格式 if [ condition ];then 符合该if时执行的语句 elif [ condition ];then 符合该if时执行的语句 else 都不符合时执行的语句 f ...
分类:
系统相关 时间:
2020-06-25 19:51:49
阅读次数:
70
深拷贝 // 深拷贝拷贝多层, 每一级别的数据都会拷贝. var obj = { id: 1, name: 'andy', msg: { age: 18 }, color: ['pink', 'red'] }; var o = {}; // 封装函数 function deepCopy(newobj ...
分类:
其他好文 时间:
2020-06-25 19:26:28
阅读次数:
58