Solution (source code)

= Solution

Let $N_+=\#\{i:Y_i>0\}$, $N_0=n-N_+$, and $a=1-e^{-\lambda}$. Ignoring factors independent of $\pi$, the likelihood is
$$
L(\pi)\propto\pi^{N_+}(1-a\pi)^{N_0}.
$$
The unconstrained critical point satisfies
$$
\frac{N_+}{\pi}-\frac{aN_0}{1-a\pi}=0,
$$
so, after enforcing $0\leq\pi\leq1$,
$$
\boxed{\widehat\pi_{\rm MLE}
=\min\left\{1,\frac{N_+}{n(1-e^{-\lambda})}\right\}.}
$$