File: root - text - article - 2020 - 02 - spreadsheet-columns.txt
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 3609 Views, 27281 Search Bots | 80 Words
| Browse | Archive
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 3609 Views, 27281 Search Bots | 80 Words
| Browse | Archive
Hi, here's your problem today. This problem was recently asked by Apple:
In many spreadsheet applications, the columns are marked with letters. From the 1st to the 26th column the letters are A to Z. Then starting from the 27th column it uses AA, AB, ..., ZZ, AAA, etc.
Given a number n, find the n-th column name.
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Cateogry: Computing | 3609 Views, 27281 Search Bots | 80 Words In many spreadsheet applications, the columns are marked with letters. From the 1st to the 26th column the letters are A to Z. Then starting from the 27th column it uses AA, AB, ..., ZZ, AAA, etc.
Given a number n, find the n-th column name.
def column_name(n):
# Fill this in.
print column_name(26)
print column_name(27)
print column_name(28)
# Z
# AA
# AB
Related Articles
- Fix Brackets
- Number of Ways to Climb Stairs
- Daily Interview Problem: Maximum Profit From Stocks
- [Daily Problem] Angles of a Clock
- Daily Interview Problem: Circle of Chained Words
- Daily Interview Problem: Find the k-th Largest Element in a List
- Daily Interview Problem: Running Median
- Daily Interview Problem: Tree Serialization
- Daily Interview Problem: Merge Overlapping Intervals
- Daily Interview Problem: Given two arrays, write a function to compute their intersection.
©2006~2024 SteakOverCooked - 0.00885 Seconds(s) - 2173.892 KB/s - 25 Online Memory: 491.45 KB
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - Server PHP Version: 7.4.33
How to Cook a Perfect Steak? | <meta name="robots" content="noindex, follow" />
18:54:01 up 13 days, 18:33, 2 users, load average: 0.98, 0.86, 0.73 - Server PHP Version: 7.4.33
Comments (0)
Read & Write - Normal - Mini - Post - All Comments - Statistics
Be the first one to comment this page !