My wrong answer

```
public String convertToTitle(int n) {
StringBuilder sb = new StringBuilder();
int k = getPower(n);
while(n>0){
int base = (int)Math.pow(26,k);
int numofbase = numofbase = (n-1)/base;
sb.append((char)(numofbase+65));
n -= (numofbase+1)*base;
k--;
}
return sb.toString();
}
public int getPower(int x){
int ret = 0;
x--;
while(x>26){
ret++;
x/= 26;
}
return ret;
}
```