
Figure B represents the correct pattern of field lines. In figure A, field lines cross each other which is not possible because if they cross each other, at the point of intersection, there would be two directions of field lines.
In figure B, field lines are emerging in nature, so poles of magnet facing each other are north poles while opposite faces will have south polarity.