
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.
给两个整数数组 A 和 B ,返回两个数组中公共的、长度最长的子数组的长度。
说明:
1 <= len(A), len(B) <= 10000 <= A[i], B[i] < 100来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/maximum-length-of-repeated-subarray
著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
思路
定义
dp[i][j]为数组 A 从i开始往后,且数组 B 从j开始往后的两个子数组所得到的最长子数组的长度。如果
A[i] === B[i],那么dp[i][j]就等于1 + dp[i + 1][j + 1],也就是两个数组的起点各往后移一位后的最长子数组长度,如果它们不相等,那么可以直接得到dp[i][j] = 0。因为这两位为起点无法组成重复子数组。注意这里我初始化的时候的循环条件都是
i <= al这样超出一位的,把超出边界的一位初始化为 0,是为了i = A.length - 1这种情况下,也就是其中的一个数组的最后一位比较的时候,假设这时候A[i] = B[j]了,那么会去找1 + dp[i + 1][j + 1]此时超出了边界,但是这种情况下完全可以把1 + 0作为结果,也就是最长子数组长度为 1。这样就巧妙的处理了边界情况。