Sailor B gets on the plank and is later saved by a rescue team.
The thought experiment poses the question of whether Sailor B can be tried for murder because if B had to kill A in order to live, then it would arguably be in self-defense.
The Case of the Speluncean Explorers by legal philosopher Lon Fuller is a similar exploration of morality and legality in extremis.
The story was about two men who escaped from a sinking ship, one of them grabbed on a piece of plank which happened to be drifting along.
The man who survived was later held for criminal trial, but was ruled as innocent because it was an act of self defense.