Donald J. Trump is essentially two key states from the nomination.

By sweeping five states on Tuesday, he pulled only a few hundred Republican delegates short of the 1,237 he needs to win without a contested convention.

He has long been favored in the polls in two of the remaining primary states, New Jersey and West Virginia. That leaves Indiana and California as the crucial prizes that would put Mr. Trump over the top — and while he was once thought to be vulnerable in both states, polls have shown him with a modest lead.

Mr. Trump is by no means assured of holding his advantage, but it explains why his beleaguered rivals are now urgently coordinating to stop him in places where they believe they can beat him.

One big reason Mr. Trump’s math looks so good is something he has complained mightily about: party rules. In fact, the delegate rules (mostly favoring the winner, as opposed to proportional allocation) worked in his favor on Tuesday, and those rules allowed him to amass nearly half of the pledged delegates heading into the night, despite 38 percent support in the popular vote before Tuesday.