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 | 3604 Views, 27240 Search Bots | 80 Words
| Browse | Archive
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, Python, | English | Home Page | Category: Computing | 3604 Views, 27240 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 | 3604 Views, 27240 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
- Staying on a Chess Board
- Daily Interview Problem: Decode String
- First and Last Indices of an Element in a Sorted Array
- Daily Interview Problem: Minimum Removals for Valid Parenthesis
- Absolute Path
- Daily Interview Problem: Product of Array Except Self
- Daily Interview Problem: Full Binary Tree
- Palindrome Integers
- Algorithm Interview Question: H-Index
©2006~2024 SteakOverCooked - 0.00976 Seconds(s) - 1974.642 KB/s - 41 Online Memory: 492.53 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 !