The force applies an acceleration in the reverse direction of
29 N = (0.145 kg) a → a = 200 m/s²
and in order to hit the ball back with speed 40.0 m/s, this acceleration is applied over time t such that
200 m/s² = (40.0 m/s - (-40.0 m/s)) / t → t = (80.0 m/s) / (200 m/s²) = 0.4 s