Pick from C#, JavaScript or PHP to complete this task, it can be done in any IDE.
- PART 1: Given a string (columnTitle) that represents the column title as it appears in an Excel sheet, return its corresponding column number.
Example:
Input | Output |
---|---|
A | 1 |
B | 2 |
C | 3 |
Z | 26 |
AA | 27 |
AB | 28 |
- PART 2: Given a positive number, convert the number to the corresponding Excel column name.
Example:
Input | Output |
---|---|
26 | Z |
51 | AY |
52 | AZ |
80 | CB |
676 | YZ |
702 | ZZ |
705 | AAC |
php ./index.php A 1 76 AAZ
./vendor/bin/phpunit ./tests/ExcelConverter/*