It is dropped from rest from the roof of 18 m building. We need to find the work done by the gravity on the watermelon from the roof to the ground. It is same as gravitational potential energy i.e.
W = mgh
W = 846.72 Joules
So, the work done by the gravity on the watermelon is 846.72 Joules. Hence, this is the required solution.