Step-by-step explanation:
A magnet is defined as a bar magnet that produces a magnetic field which attracts or repel other objects.
A magnet has both a north pole and a south pole.
As like charges repel each other and opposite charges attract each other. Similarly, like poles repel each other and opposite poles attract each other.
So, when south pole of a magnet comes in contact with north pole of another magnet then they will attract each other.
As the given image shows that magnets are away from each other this means that they are repelling each other.