Plzz suggest me where my code went wrong for the question (DIGITREM)

Try the following case:

1
88899 9
1 Like