It usually happens with strong fermentation when the krausen clogs the airlock, it is then ejected with the pressure.
If the fermentation was still active when you returned, the beer might not be contaminated due to gas escaping the container. What makes you think it is contaminated? Is there anything unusual floating on the surface?
You can always add campden drops, but if a contamination already occur, there is no way to know if it will be enough to salvage the batch.
It could also be fine, I would continue the brewing process, smell and taste the brew from time to time to make sure there are no changes compared to what it is supposed to be.
It happened to me once, a full day without airlock and the batch turned out great. Keep your fingers crossed and hope for the best, but do not drop the batch before trying.