
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.
In a deck of cards, every card has a unique integer. You can order the deck in any order you want.
Initially, all the cards start face down (unrevealed) in one deck.
Now, you do the following steps repeatedly, until all cards are revealed:
Return an ordering of the deck that would reveal the cards in increasing order.
The first entry in the answer is considered to be the top of the deck.
Example 1:
Note:
1 <= A.length <= 1000
1 <= A[i] <= 10^6
A[i] != A[j]
for alli != j
这道题给了我们一些卡牌,让返回一种顺序,使得按照某种发牌规则可以发出从小到大的牌,发牌是翻开一张牌,然后把下一张牌移到末尾,然后再翻下一张牌,再移动下一张牌到末尾,以此类推,直至所有的牌都翻开。题目中给的例子也很好的说明了这一点,可以观察到偶数 index 上的数字是递增的,因为按照翻一张移一张的顺序,偶数 index 上的数字是要先翻开的,所以一定是有序的,关键在于奇数 index 上的数字是否也有顺序,博主看中间三个数是 13,11,17,以为是中间最小,然后向两边扩展,但是又举了一些例子,尝试了总共有偶数张牌的情况,发现无法找出一个统一的规律,就卡壳了。后来逛论坛发现大家都用的是简单粗暴的方法,根本不用找规律,直接用一个队列 queue 来模拟整个发牌规则即可。首先要给数组排个序,然后建立一个数组,把所有 index 按顺序装入队列,之后就开始遍历,先从队首取出一个 index,此时的 index 是要翻开的,所以将 deck[i] 放入结果 res 中的对应的 index 位置,然后再从队首取下一个 index,这个 index 是要移到末尾的,直接加入队列。这样操作n次之后,整个 res 数组就会被正确的赋值了,参见代码如下:
Github 同步地址:
#950
参考资料:
https://leetcode.com/problems/reveal-cards-in-increasing-order/
https://leetcode.com/problems/reveal-cards-in-increasing-order/discuss/200526/Java-Queue-Simulation-Step-by-Step-Explanation
https://leetcode.com/problems/reveal-cards-in-increasing-order/discuss/200515/JavaC%2B%2BPython-Simulate-the-Reversed-Process
LeetCode All in One 题目讲解汇总(持续更新中...)
The text was updated successfully, but these errors were encountered: