
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 positive integer, return its corresponding column title as appear in an Excel sheet.
For example:
Example 1:
Example 2:
Example 3:
Credits:
Special thanks to @ifanchu for adding this problem and creating all test cases.
此题和 Excel Sheet Column Number 是一起的,但是我在这题上花的时间远比上面一道多,其实原理都一样,就是一位一位的求,此题从低位往高位求,每进一位,则把原数缩小26倍,再对26取余,之后减去余数,再缩小26倍,以此类推,可以求出各个位置上的字母。最后只需将整个字符串翻转一下即可。我们先从最简单的来看,对于小于26的数字,那么我们只需要对26取余,然后减去1,加上字符A即可,但是对于26来说,如果还是这么做的话就会出现问题,因为对26取余是0,减去1后成为-1,加上字符A后,并不等于字符Z。所以对于能被26整除的数我们得分开处理,所以就分情况讨论一下吧,能整除26的,直接在结果res上加上字符Z,然后n自减去26;不能的话,就按照一般的处理,n要减去这个余数。之后n要自除以26,继续计算下去,代码如下:
解法一:
然后我们可以对上面对方法进行下优化,合并if和else,写的更简洁一些。从上面的讲解中我们得知,会造成这种不便的原因是能被26整除的数字,无法得到字符Z。那么我们用一个小trick,比如对于26来说,我们先让n自减1,变成25,然后再对26取余,得到25,此时再加上字符A,就可以得到字符Z了。叼就叼在这对其他的不能整除26的数也是成立的,完美解决问题,参见代码如下:
解法二:
这道题还可以用递归来解,而且可以丧心病狂的压缩到一行代码来解:
解法三:
类似题目:
Excel Sheet Column Number
参考资料:
https://leetcode.com/problems/excel-sheet-column-title/
https://leetcode.com/problems/excel-sheet-column-title/discuss/51399/Accepted-Java-solution
https://leetcode.com/problems/excel-sheet-column-title/discuss/51398/My-1-lines-code-in-Java-C%2B%2B-and-Python
https://leetcode.com/problems/excel-sheet-column-title/discuss/51421/Share-my-simple-solution-just-a-little-trick-to-handle-corner-case-26
LeetCode All in One 题目讲解汇总(持续更新中...)
The text was updated successfully, but these errors were encountered: