The landlord is responsible for replacing the carpet that was destroyed in the flood.  In every lease, there is an implied warranty of habitability which means that the landlord must maintain the premises in a habitable condition by complying with local and state housing codes.  The exposed nails would pose a health and safety issue and would constitute a breach of the implied warranty of habitability.  You could sue the landlord for breach of the implied warranty of habitability. When there is a breach of the implied warranty of habitability, the tenant can move out and terminate the obligation to pay rent for the balance of the term of the lease or if the tenant remains on the premises, withhold rent and defend against eviction.Another option would be for the tenant to make the repairs and deduct the cost from the rent.