Computing the hexadecimal number formed so far and storing it in a vector .
if ( check == 4 or i == 0 ) : NEW_LINE INDENT if ( sum <= 9 ) : NEW_LINE INDENT ans . append ( chr ( sum + ord ( '0' ) ) ) NEW_LINE DEDENT else : NEW_LINE INDENT ans . append ( chr ( sum + 55 ) ) ; NEW_LINE DEDENT DEDENT