Several states, from New York to California, have been forced to close down stretches of their shores due to high levels of bacteria in the water.