#include <string.h> #include <math.h> int getNumber(char* S ) { // write code here int len = strlen(S); int sum = 0; int i = 0; while(i < len) { sum += (S[i] - 'A' + 1) * pow(26,len - i -1); i++; } return sum; }
#include <string.h> #include <math.h> int getNumber(char* S ) { // write code here int len = strlen(S); int sum = 0; int i = 0; while(i < len) { sum += (S[i] - 'A' + 1) * pow(26,len - i -1); i++; } return sum; }