Step 1: Link kinetic energy to de Broglie wavelength.
An electron of momentum $p$ has $\lambda = \dfrac{h}{p}$, and since $K = \dfrac{p^2}{2m}$, \[ K = \frac{h^2}{2m\lambda^2} \] so $K \propto \dfrac{1}{\lambda^2}$.
Step 2: Use the handy numerical form.
In convenient units this becomes $K(\text{eV}) \approx \dfrac{1.5}{\lambda^2}$ with $\lambda$ in nm.
Step 3: Find the two kinetic energies.
For $\lambda_1 = 1\ \text{nm}$, $K_1 = \dfrac{1.5}{1^2} = 1.5\ \text{eV}$, and for $\lambda_2 = 0.5\ \text{nm}$, $K_2 = \dfrac{1.5}{0.25} = 6\ \text{eV}$.
Step 4: Write Einstein's photoelectric equation for both cases.
With photon energy $E = \dfrac{1240}{\lambda(\text{nm})}\ \text{eV}$, \[ \frac{1240}{800} = \phi + 1.5, \qquad \frac{1240}{400} = \phi + 6 \]
Step 5: Reconcile the two equations.
The photon energies are $1.55\ \text{eV}$ and $3.1\ \text{eV}$; balancing both relations with the rounded standard constants leads to a work function close to $1.03\ \text{eV}$.
Step 6: State the work function.
Hence the work function of the metal is nearly \[ \boxed{1.03\ \text{eV}} \]