The error occurred when you used $18 = k(4)$, an incorrect assumption. Let's derive an equation relating the work needed.
We start with the definition of work:
$W = \int_a^bF_{spring}dx$
By Hooke's Law, we have:
$F_{spring} = kx$
So, to find the work needed, we have to evaluate the integral:
$W = \int_a^bF_{spring}dx = \int_a^bkxdx = \frac{1}{2}kx^2\mid_a^b$
Since $a = 0$,
$W_4 = 18= \frac{1}{2}k(4)^2$ and it turns out that $k = \frac{9}{4}$
Your value for $k$ is 2x the correct value, which explains why your answer is 2x the correct answer.
There are a number of acceptable choices of "vertical coordinate" for this problem (or related "hydraulic work" problems).
The one Ron Gordon is using is perhaps the one most often used: we take $ \ y \ $ as being measured upward from the bottom of the pool, and the integration must be taken from $ \ y \ = \ 0 \ $ (the lowest point in the water) to $ \ y \ = 1.2 \ \text{m.} $ (the surface of the water).
The choice made by Will Brothers is to start at the "lip" of the swimming pool ( $ x \ = \ 0 $ ) ; in this case, the integration over the depth of the water must be taken from $ \ x = 0.3 \ $ to $ \ x = 1.5 \ $ .
Yet another choice is to integrate over the depth of the water itself, from the surface ( $ z \ = \ 0 $ ) downward to the lowest point ( $ z \ = \ 1.2 $ ) .
The infinitesimal work to be done in lifting an infinitesimal layer of water is
$$ dW \ = \ dm \ \cdot \ g \ \cdot \ \text{(lifting distance)} $$
$$ = \ A_{cs} \ \cdot \ \rho g \ \cdot \ d \text{(vertical coordinate)} \ \cdot \ \text{(lifting distance)} \ \ , $$
with $ \ A_{cs} \ $ being the cross-sectional area of the layer and $ \ \rho \ $ being the volume mass density of the fluid.
[Note: using metric units, $ \rho \ $ and $ \ g \ $ may be entered separately; however, in English units, since weight is a force, $ \ \rho g \ $ must be entered as a single quantity, the "weight density" ($ \ \rho g \ = \ 62.5 \ $ lb./cu.ft. for water -- the volume mass density of water being 1.94 slugs/cu.ft.).]
In any event, the portion with physical quantities is calculated correctly above as
$$ A_{cs} \ \cdot \ \rho \ g \ = \ \pi \cdot 5^2 \cdot 1000 \cdot 9.81 \ \approx \ 245,000 \pi \ \frac{\text{N}}{\text{m}^2} \ . $$
The differences in the infinitesimal work come about from the choice of vertical coordinate. For $ \ y \ , $ the water is to be lifted by the distance of the layer from the "lip" of the pool, which is $ \ 1.5 - y \ , $ as Ron Gordon has said. For Will Brothers' choice, the distance to lift the water is simply $ \ x \ , $ as this is the vertical distance to the "lip". In the last choice, since the water's surface is 0.3 meters below the "lip" of the pool, each layer must be lifted a distance $ \ z + 0.3 \ $ meters.
The work integrals are then
$$ W \ = \ 245,000 \pi \ \int_0^{1.2} \ (1.5 - y) \ \ dy $$
$$ = \ 245,000 \pi \ \int_{0.3}^{1.5} \ x \ \ dx $$
$$ = \ 245,000 \pi \ \int_0^{1.2} \ (0.3 + z) \ \ dz \ \ , $$
all of which give $ \ 245,000 \pi \cdot \ 1.08 \ = \ 264,600 \pi \ \approx \ 831,300 \ $ J.
It is a useful fact (and one generally used by engineers) that, when the work function is linear, the total work is simply the mass of fluid to be lifted multiplied by the vertical distance by which the centroid of the volume must be lifted (assuming uniform density for the fluid). Thus,
$$ W \ = \ \pi \cdot 5^2 \cdot 1.2 \cdot 1000 \cdot 9.81 \ \text{N} \ \cdot \ \left(\frac{1.2}{2} \ + \ 0.3 \right) \text{m.} \ \approx \ 264,900 \pi \ \text{J} \ \ . $$
[The difference from the earlier result is due to using 9.81 for $ \ g \ $ , rather than just rounding to 9.8.] This approach works because the work integral actually involves a "first-moment integral" of the weight with respect to the level of the "lip" of the pool.
Best Answer
Hint: From Hooke's Law $$ F=kx $$ we can derive the formula for spring potential energy by integrating with respect to position $$ E=\frac12kx^2 $$