Binary numbers (Base 2) are from 0 to 1 and next numbers are 10,11,100.........

octal numbers (Base 8) are from 0 to 7 and next numbers are 10,11,12.......17,20,............

when we remove all 9's the numbers are from 0 to 8 and next numbers are 10,11,12....18,20,.....

hence after removing 9 we get Base 9. so finding this Base 9 number is similar to Binary Number (Base 2) & octal numbers (Base 8).

we need to use Division and modulo of 9 instead of 2 (for Binary) or 8 (for octal).

Example:

if n = 10;

10%9 * 10^0 + (10/9)%9*10^1;

1+10 = 11;

```
class Solution {
public:
int sum = 0, i = 0 ;
int newInteger(int n) {
if(n == 0) return sum;
sum += n%9*pow(10,i++);
return newInteger(n/9);
}
};
```