Consider the upward direction of motion as positive and downward direction of motion as negative.
a = acceleration due to gravity in downward direction = - 9.8

v₀ = initial velocity of rock in upward direction = ?
v = final velocity of rock at the highest point = 0

t = time to reach the maximum height = 4.2 sec
Using the kinematics equation
v = v₀ + a t
inserting the values
0 = v₀ + (- 9.8) (4.2)
v₀ = 41.2
