DoorDash said on Thursday that it had agreed to buy Instacart for $17 billion, in a deal that would fold the nation’s ...