For vertically upward motion: g is negative as it opposes the motion.
v = u – gt
0 = u – gt
t = u/g …..(1)
For vertically downward motion: g is positive as it is in the direction of motion.
v = u + gt
v = 0 + gt
t = v/g …..(2)
From equation 1 and 2
v = u