
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 a time represented in the format "HH:MM", form the next closest time by reusing the current digits. There is no limit on how many times a digit can be reused.
You may assume the given input string is always valid. For example, "01:34", "12:09" are all valid. "1:34", "12:9" are all invalid.
Example 1:
Example 2:
这道题给了我们一个时间点,让我们求最近的下一个时间点,规定了不能产生新的数字,当下个时间点超过零点时,就当第二天的时间。为了找到下一个时间点,我们肯定是从分钟开始换数字,而且换的数字要是存在的数字,那么我们最先要做的就是统计当前时间点中的数字,由于可能有重复数字的存在,我们把数字都存入集合set中,这样可以去除重复数字,并且可以排序,然后再转为vector。下面就从低位分钟开始换数字了,如果低位分钟上的数字已经是最大的数字了,那么说明要转过一轮了,就要把低位分钟上的数字换成最小的那个数字;否则就将低位分钟上的数字换成下一个数字。然后再看高位分钟上的数字,同理,如果高位分钟上的数字已经是最大的数字,或则下一个数字大于5,那么直接换成最小值;否则就将高位分钟上的数字换成下一个数字。对于小时位上的数字也是同理,对于小时低位上的数字情况比较复杂,当小时高位不为2的时候,低位可以是任意数字,而当高位为2时,低位需要小于等于3。对于小时高位,其必须要小于等于2,参见代码如下:
解法一:
下面这种方法的写法比较简洁,实际上用了暴力搜索,由于按分钟算的话,一天只有1440分钟,也就是1440个时间点,我们可以从当前时间点开始,遍历一天的时间,也就是接下来的1440个时间点,得到一个新的整型时间点后,我们按位来更新结果res,对于每个更新的数字字符,看其是否在原时间点字符中存在,如果不存在,直接break,然后开始遍历下一个时间点,如果四个数字都成功存在了,那么将当前时间点中间夹上冒号返回即可,参见代码如下:
解法二:
参考资料:
https://discuss.leetcode.com/topic/104692/c-java-clean-code
https://discuss.leetcode.com/topic/104736/concise-java-solution
https://discuss.leetcode.com/topic/105411/short-simple-java-using-regular-expression
LeetCode All in One 题目讲解汇总(持续更新中...)
The text was updated successfully, but these errors were encountered: