We'll ignore air resistance. Denote the gravitational acceleration as `g ((m)/(s^2)).`
Then the speed is `V(t) = V_0 - g t,` where `V_0` is the initial upward speed. The last moment of an upward journey is that moment when `V(t) = 0.` Therefore `1` second before this the speed (denote it as `V_1`) is greater than zero by `g*1 m/s.` It is `g m/s` regardless of `V_0.`
The distance traveled during the last second is `dH = V_1 t-(g t^2)/2,` and recall that `t = 1 s` and `V_1 = g m/s.` Thus `dH = g - g/2 = g/2` regardless of the initial speed.
So the answer is: the distance is 5 m, the same as in the first case.
Note 1. The result of `5 m` means that the value of `g = 10 m/s^2` was used.
Note 2. For initial speeds less than `10 (m)/s` the above reasoning appears incorrect.