We add two digits to handle cases that make two digits after doubling
nSum += d // 10 NEW_LINE nSum += d % 10 NEW_LINE isSecond = not isSecond NEW_LINE if ( nSum % 10 == 0 ) : NEW_LINE return True NEW_LINE else : NEW_LINE return False NEW_LINE