Maytag washer overfills the water

My Maytag washer MTW5740TQO over fills and floods water
On a site it suggested 2 different parts for this problem…But I do I know which to buy?? They are not cheap parts!!

Here are your parts
http://www.appliancepartspros.com/partsearch/model.aspx?model_id=5139174

See the attachment for the tech sheet.

Following is how to narrow it down.
Note that your unit also has an ATC (automatic temperature control) that may also be the problem.

This level switch (Item 4 in Section 2) is actually a pressure switch. It has a tube that runs down to the bottom of the tub, as water fills the tub, air is trapped in the tube. As the water rises, the air pressure in the tube increases until it reaches the switch’s set point then the switch activates turning off the water and starting the agitate.

Possible problems.

  1. Gunk blocking water from entering the tube. Remove the tube at the switch and blow into it to clear the plug.
  2. Cracks or holes in the tube allowing the air to escape. Inspect the tube. Also check that it is tight on the switch, if not, cut off half an inch and re-seat it.
  3. The switch is toast. Get a piece of tubing with the same internal diameter and attach this to the switch. Start a fill, then blow into the tube. You should be able to stop the water flow without blowing very hard.
    If you cannot stop it the switch is toast.

Note: That you may be able to stop it by blowing into then tubing and it may still be no good as it needs too much pressure to activate the switch.
So if the tubing is OK replace the switch.

Note: I am assuming that you can stop the water flow by unplugging or turning off the unit.
If the only way to stop it is to shut off the taps your water valve is shot.
Also could be the ATC,