Blow dry air into the room through box fans placed in windows and ceiling fans. Use fans on their highest settings and aim them along the surface of carpets that are in rooms (or hallways) with no windows.
Open all drapes (or curtains) to let the sun shine into the room.
Run a strong wet/dry vacuum over the carpet. Dump the water, and vacuum again. Continue the process until the vacuum stops sucking water.
Run the fans until the carpet goes from wet to damp.
Apply a carpet shampoo to the carpet while it is still slightly damp.
Apply a solution of 2 tablespoons of bleach to each gallon of water to the carpet, if you particularly worried about mold growth. Test the solution on a small part of the carpet to make sure it does not ruin colors. If the colors remains the same, apply the beach/water solution to the entire carpet.
Continue to run fans and expose carpet to as much sun as you can. Run a dehumidifier in the room. Allow the carpet to dry completely, giving it as much time as needed.