I was recently asked in a job interview to resolve a programming puzzle that I thought it would be interesting to share. It\'s about translating Excel column letters to actu
public static int convertNameToIndex(String columnName) {
int index = 0;
char[] name = columnName.toUpperCase().toCharArray();
for(int i = 0; i < name.length; i++) {
index *= 26;
index += name[i] - 'A' + 1;
}
return index;
}