The correct option is B Both assertion and reason are true and the reason is the correct explanation of the assertion.
If both force and displacement are in the same direction, work done is said to be positive. Whereas, work done is negative if the force and displacement are in opposite directions.
The direction of force applied and displacement is the same while stretching or compressing the spring. Hence, the work done by stretching or compressing a spring is positive