Problem stated it’s necessary to calculate column number in Excel. Assuming Excel is the name for Microsoft Excel application, even for its latest version spreadsheet can only contain 16,384 columns, so the last column name is XFD. However validation is saying solution is incorrect because it’s not giving expected answer for ABCD string, which can’t represent any Excel column name. Either problem description should be changed in order to include border conditions or validator should have excluded any cases for strings with length > 3 symbols.

# Validation on string length > 3

@amakhnev The question setter intends to convey that the numbers to the column titles should be done like the column numbers mentioned in EXCEL. Therefore he has mentioned “as in EXCEL”. The constraints of the number of columns in EXCEL have no relation to the constraints of this question. Although the language of the question could have been more clear but still one has to keep in mind the programming constraints. Hope it helps.