making problem 4 faster by not prepending to the digits index