I have the following problem.
Given A=1, B=2 , ... , Z =26
I need an algorithm that given a letter combination, like the column order in excel, returns me the number/
AA=27 AB=28
ABC?
Thanks a lot
This is my algorithm so far, I dont like the switch inside the for. Any help is appreciate it, I will write it later in c#
Given A=1, B=2, Z=26. AB=27, ABC?
Variable = ABC
Positions = Variable.Length -1
Int result= 0
FOR (i=0; i<= Positions; i++)
{
Letter=Variable[i];
Switch(Letter)
Case A:
LetterValue=1
result=+ result+26*(LetterValue)^i
}