Submit solution
Points:
20 (partial)
Time limit:
1.0s
Memory limit:
32M
Author:
Problem type
Allowed languages
Python
Problem Statement
Given an integer columnNumber, return its corresponding column title as it appears in an Excel sheet.
For example:
A -> 1
B -> 2
C -> 3
...
Z -> 26
AA -> 27
AB -> 28
...
Input Specification
The first line of the input gives the number of test cases, , test cases follow. Each test case consists of a line. The line contains a natural number .
Limits
Memory limits: 32MB.
Time limits: 1 second.
Test Set 1
Sample Case
Test Set 2
Test Set 3
Test Set 4
Output Specification
For each test case, output one line containing Case #x: y
, where is the case number(starting from 1), and is the column title in an Excel sheet.
Sample Input
3
1
26
28
Sample Output
Case #1: A
Case #2: Z
Case #3: AB
Ref
https://leetcode.com/problems/excel-sheet-column-title/
Hint
chr
ord
mod operator
Comments