What's your Realtor advising?
Beyond that, even a home that's being sold "as is" can have its purchase subject to a home inspection. Investors do that all the time. They'll offer to buy a home "as is" but then have it inspected. If the inspection turns up problems the investors hadn't seen, then the investors invoke the home inspection contingency to get out of the deal.
Recognize that any contingency weakens your offer. If the bank receives two offers--one yours and another one identical except that there's no inspection contingency--that other offer is likely to get the house.Still, in this case, you need a home inspection. You really should have one any time you buy a house.
And you really are facing two questions. The first is: What caused the flooding? Was it a one-time event (such as a burst pipe)? Or is it something that recurs? If it does happen periodically, is it an easy fix? (Maybe outside regrading. May a sump pump. Maybe a French drain.) Or is the fix difficult or impossible? A home inspector probably can answer those questions. If it's something structural--such as a crack in the foundation--then you'd probably need someone like a structural engineer. (And at that point, you might just want to terminate the transaction.)
The second question is: What will it cost to clean up the problem? How extensive will the mold remediation be?
Your Realtor probably has advised you to make an offer contingent on a home inspection. And to make the offer low enough to account for the remediation and repairs. That's what I'd suggest.
One bright spot: Mold scares off lots of buyers. But mold and its underlying cause can be addressed. You just have to know how much it'll cost, and factor that into your offer.
But the main point is: Yes, you can buy a home "as is" subject to a home inspection.
Hope that helps.