Two men
(Matt. 8:28) – “And when He had come to the other side into the country of the Gadarenes, two men who were demon-possessed met Him as they were coming out of the tombs; they were so exceedingly violent that no one could pass by that road.”
One man
(Mark 5:1-2) – “And they came to the other side of the sea, into the country of the Gerasenes. 2And when He had come out of the boat, immediately a man from the tombs with an unclean spirit met Him,”
(Luke 8:26-27) – “And they sailed to the country of the Gerasenes, which is opposite Galilee. 27And when He had come out onto the land, He was met by a certain man from the city who was possessed with demons; and who had not put on any clothing for a long time, and was not living in a house, but in the tombs.”
A contradiction occurs only when one statement makes the other impossible. If Mark or Luke said that only one demoniac came to Jesus while Matthew says that two came out, that would be a contradiction. If there are two demoniacs, there is certainly at least one; therefore, there is no contradiction.
The simple fact is that Matthew mentions two of the demoniacs while Mark and Luke only mention one. We do not know why they chose to mention only one.