Unfortunately, that is wrong as well. Ships generally can support their own weight if only supported at the ends. Because waves exist a ship can find itself with the stern on one crest and the bow on the next with little or nothing supporting the middle. The under keel explosion works better because:
(1) The weight of the ship acts against the explosion increasing the initial stress
(2) The gas bubble created can vent straight up on a side explosion. Under the keel means it has to go through/around the ship increasing the stress.
(3) Since the explosion lifts the ship you're going to get significant additional damage when it crashes back down into the water.
(4) Like (2) as the gas bubble disperses water rushes back into the vacuum. All of this water coming back in will collide in the middle resulting in a geyser going straight up into the ship.
I was thinking the support it at the ends and it will break explanation is lacking.
Thinking about it is you detonate an explosive under a boat it's going to create a shock wave that will hit the boat like a hammer and probably do a fair bit of damage to the hull before maybe the support at the ends thing happens.