Code Golf: Numeric Equivalent of an Excel Column-Name
- by Vivin Paliath
Can you figure out the numeric equivalent of an Excel column string in the shortest-possible way, using your favorite language? For example, the A column is 1, B is 2, so on and so forth. Once you hit Z, the next column becomes AA, then AB and so on.
Rules:
Here is some sample input and output:
A: 1
B: 2
AD: 30
ABC: 731
WTF: 16074
ROFL: 326676
I don't know if the submitter is allowed to post a solution, but I have a Perl solution that clocks in at 125 characters :).