Instructions
Avoid bubbles. He spits out five bubbles at a time. Hitting a bubble will take away a unit of health, so don't get hit.
Catch vegetables. Every so often, a vegetable will pop out of one of the three pipes in the background. When that happens, get underneath the vegetable while holding the B button in order to catch it.
Jump on the platforms located above the three pipes. This is best accomplished by first jumping up to the red floor that the middle pipe sits on, and from there, jumping up to the left floating platform. After that, jump to the right platform.
Run up to the right edge of the platform you're on, but be careful not to fall off. Jump off the platform and to the right. This will land you behind Wart.
Turn around. Throw the vegetable at Wart when he opens his mouth. The great thing about being behind him is that you don't have to worry about dodging any bubbles. Wart is too stupid to simply turn around and face you.
Repeat Steps 1 through 5 five more times. It takes six hits to defeat Wart.
Great job. Now enjoy the ending. I refuse to spoil it for you.