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 | 3625 Views, 28337 Search Bots | 80 Words
| Browse | Archive
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 3625 Views, 28337 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 | 3625 Views, 28337 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
- Daily Interview Problem: Reverse Integer
- 56 Bytes
- Algorithm Interview: Shifted String
- Daily Interview Problem: Validate Binary Search Tree
- Staying on a Chess Board
- Algorithm Interview Question: H-Index
- Longest Substring Without Repeating Characters
- [Daily Problem] Validate Balanced Parentheses
- Daily Interview Problem: Product of Array Except Self
- Algorithm Interview: Level Order Traversal of Binary Tree
©2006~2024 SteakOverCooked - 0.00715 Seconds(s) - 2674.51 KB/s - 14 Online Memory: 492.69 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 !