Adding code for finddigits problem