Donald Trump also flipped Georgia, which had voted for Democrats four years ago, and retained the closely contested state of North Carolina.