Write a function to parse a formatted string containing transaction data, handle malformed inputs, and output the computed totals.
Use def parse_transaction_totals(data):. The input contains newline-separated records in the format account,amount, where account is nonempty and amount is an integer. Ignore blank or malformed records, and return a dictionary mapping each valid account to the sum of its amounts.
def parse_transaction_totals(data):