Find out the source of the water if you can. You can start by seeing if the house is in a flood zone. It might be something as simple as regrading the property or if the house is in the direct waterway of a water source, it might take a bit more work and money to fix.
But, if you love the house, go for it!
Each home sale is different, and it's best to talk to your agent and your attorney to explore options that are available.