
Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
History is littered with hundreds of conflicts over the future of a community, group, location or business that were "resolved" when one of the parties stepped ahead and destroyed what was there. With the original point of contention destroyed, the debates would fall to the wayside. Archive Team believes that by duplicated condemned data, the conversation and debate can continue, as well as the richness and insight gained by keeping the materials. Our projects have ranged in size from a single volunteer downloading the data to a small-but-critical site, to over 100 volunteers stepping forward to acquire terabytes of user-created data to save for future generations.
The main site for Archive Team is at archiveteam.org and contains up to the date information on various projects, manifestos, plans and walkthroughs.
This collection contains the output of many Archive Team projects, both ongoing and completed. Thanks to the generous providing of disk space by the Internet Archive, multi-terabyte datasets can be made available, as well as in use by the Wayback Machine, providing a path back to lost websites and work.
Our collection has grown to the point of having sub-collections for the type of data we acquire. If you are seeking to browse the contents of these collections, the Wayback Machine is the best first stop. Otherwise, you are free to dig into the stacks to see what you may find.
The Archive Team Panic Downloads are full pulldowns of currently extant websites, meant to serve as emergency backups for needed sites that are in danger of closing, or which will be missed dearly if suddenly lost due to hard drive crashes or server failures.
Given an array consisting of
n
integers, find the contiguous subarray of given lengthk
that has the maximum average value. And you need to output the maximum average value.Example 1:
Note:
k
<=n
<= 30,000.这道题给了我们一个数组nums,还有一个数字k,让我们找长度为k且平均值最大的子数组。由于子数组必须是连续的,所以我们不能给数组排序。那么怎么办呢,在博主印象中,计算子数组之和的常用方法应该是建立累加数组,然后我们可以快速计算出任意一个长度为k的子数组,用来更新结果res,从而得到最大的那个,参见代码如下:
解法一:
由于这道题子数组的长度k是确定的,所以我们其实没有必要建立整个累加数组,而是先算出前k个数字的和,然后就像维护一个滑动窗口一样,将窗口向右移动一位,即加上一个右边的数字,减去一个左边的数字,就等同于加上右边数字减去左边数字的差值,然后每次更新结果res即可,参见代码如下:
解法二:
参考资料:
https://discuss.leetcode.com/topic/96134/c-simple-sliding-window-solution
https://discuss.leetcode.com/topic/96154/java-solution-sum-of-sliding-window
LeetCode All in One 题目讲解汇总(持续更新中...)
The text was updated successfully, but these errors were encountered: