In a high humidity environment, there may be little room for additional moisture to evaporate into the air. Air conditioners remove humidity from the air, which allows more room for moisture to evaporate from the carpet. Therefore, in a high humidity situation, turning on the air conditioner will speed up the carpet's drying process.
Rooms with low humidity are able to absorb more moisture into the air, but a higher ambient temperature can accelerate the evaporation process. In a low humidity environment, turning on the heater can provide extra heat needed to speed up the evaporation of moisture in a carpet allowing it to dry faster.
The humidity conditions in a room will determine the speed at which a wet carpet will dry. Depending on these conditions, and any changes in humidity that might occur, using the air conditioner, heater or alternating between them can accelerate the drying of a wet carpet. Determining and responding to humidity levels is the key to the most efficient method.