### Short answer
From a purely ethical standpoint, the car should swerve and minimize total loss of life—kill one to save five—provided this is a publicly known, precommitted policy that passengers consent to ex ante.

### Why
- **Impartial harm minimization (utilitarianism)**: Five lives saved outweigh one life lost.
- **Veil-of-ignorance (contractualism)**: Before knowing whether you’re a passenger or pedestrian, most rational agents would choose a rule that minimizes expected deaths.
- **Rule ethics and fairness**: The rule must be general, public, and non-discriminatory (no decisions based on identity), and accepted beforehand to respect passenger autonomy.
- **“Killing vs letting die” objection**: In autonomous control, either outcome is the result of a designed choice; the morally relevant comparison is expected harm, not the act/omission label.
- **Fault doesn’t change the duty**: Even if pedestrians erred, the immediate ethical duty is to minimize preventable harm now.

### Practical constraints
- Use expected-harm minimization under uncertainty (swerve only if it genuinely reduces expected deaths).
- Apply the same rule universally; forbid identity-based weighting.
- Make the policy explicit so passengers opt in knowingly.

- Saved more lives with a consistent, consented harm-minimization rule; swerve if it truly lowers expected fatalities.