Combined two cases for 'toDigitsRev' on homework 1a