Solution (source code)

= Solution

The corrected <Kaplan–Meier estimator> is $2/3$ immediately after $t=2$ and
$$
(2/3)^2=4/9
$$
immediately after $t=7$. It first crosses one half there, so
$$
\boxed{\widehat{\operatorname{median}}(T)=7\text{ years}.}
$$