Tens of millions of dollars were spent on this year’s North Carolina campaigns, and much of it came from outside the state.