As the water is leaking uniformly out of the bucket.
So the mass of the bucket is varying uniformly w.r.t height 'h'
If we plot the curve for force (along y-axis) versus height (or displacement along x-axis). Then area under the curve is the work done
Here area under the curve will be = (1/2) base*altitude
or W = (1/2)*(20m)*(20g-10g)N = 100g Joules = 1000 Joules