## Amazon Interview Question

Java Developers**Country:**United States

Here's a python solution

```
def remove4(number):
if number == 0:
return 0
digit = int( math.log10(number) )
theNumber = int(int(number) / int(10 ** digit))
theRest = number - theNumber * 10 ** digit
if theNumber >= 4:
theNumber -= 1
return theNumber * 9 ** digit + remove4(theRest)
```

- learn.vira.mahesh May 12, 2018