题意:求每个点的子树中哪一层节点数最多,如果有节点数最多不唯一,取层数最小的。 题解:dus on tree 基本想法是对每一个节点都构建一个deep数组,然后从底向上更新过来,但是这样空间复杂度和时间复杂度都会是O(n^2)无法承受。 然后向办法共用deep数组和记录其数值的数组,那么这时候对于一 ...
分类:
其他好文 时间:
2018-07-15 19:44:01
阅读次数:
176
Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. Example: Given nums = [-2, 0, 3, -5, 2, -1] sumR ...
分类:
其他好文 时间:
2018-07-15 19:32:41
阅读次数:
125
1.request.js 函数封装 2.注:向后台传递数组的方法 需要在qs的方法中设置它的indices为false即可,如: . ...
分类:
Web程序 时间:
2018-07-09 00:37:54
阅读次数:
2007
"1. Two Sum" Description Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that ...
分类:
其他好文 时间:
2018-07-07 22:14:55
阅读次数:
158
Example: Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input woul ...
分类:
其他好文 时间:
2018-07-05 15:51:29
阅读次数:
162
原文链接https://www.cnblogs.com/zhouzhendong/p/9256033.html 题目传送门 - CF873F 题意 给定长度为 $n$ 的字符串 $s$,以及给定这个字符串每一个位置是否 “禁止结尾” 的信息。 一个字符串 $a$ 的价值为 $|a|\times f( ...
分类:
其他好文 时间:
2018-07-02 23:09:12
阅读次数:
512
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex ...
分类:
其他好文 时间:
2018-06-29 01:14:22
阅读次数:
170
Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have ex ...
分类:
其他好文 时间:
2018-06-21 11:53:54
阅读次数:
186
Given a list of unique words, find all pairs of distinct indices (i, j) in the given list, so that the concatenation of the two words, i.e. words[i] + ...
分类:
其他好文 时间:
2018-06-21 11:34:26
阅读次数:
115
[抄题]: Given an integer array nums, find the sum of the elements between indices i and j (i ≤ j), inclusive. The update(i, val) function modifies nums ...
分类:
其他好文 时间:
2018-06-16 12:02:08
阅读次数:
132