Drying out the subfloor is critical and that can’t happen with pad and carpet in place
adhesives used in plywood and OSB manufacturing can release when damp for extended periods causing subfloor panels to warp and delaminate; staples holding down the pad will rust, mold can occur in pad, carpet and subfloor materials
first and foremost, the cause of the wet floor needs remedied or it will happen again; then dry everything out thoroughly before replacing carpet and pad
if the drywall behind the baseboard got wet, the baseboards need to come off to allow the gypsum board to dry completely as well
adhesives used in plywood and OSB manufacturing can release when damp for extended periods causing subfloor panels to warp and delaminate; staples holding down the pad will rust, mold can occur in pad, carpet and subfloor materials
first and foremost, the cause of the wet floor needs remedied or it will happen again; then dry everything out thoroughly before replacing carpet and pad
if the drywall behind the baseboard got wet, the baseboards need to come off to allow the gypsum board to dry completely as well