Depends on if your friend is the landlord or tenant.
It is a tenant created problem. The tenant should pay. The reason is simple, it had carpet when the tenant moved in. (As gross as that is) If your friend is the tenant, she should plan on getting it cleaned, however, I suggest them talking to the landlord because…
The landlord should be smart and replace the carpet with tile or vinyl when the tenant moves out or at the first opportunity. If your friend is the landlord, she should replace and be thankful the tenant brought it up before it completely molded and rotted the floor.