Though it is not fastest, it is very easy to understand.

```
public class Solution {
public int newInteger(int n) {
if (n < 9) {
return n;
}
if (n == 9) {
return 10;
}
return newInteger(n / 9) * newInteger(9) + newInteger(n % 9);
}
}
```