He works it out with a pencil! =
Because then, it would be called Solved.
Why did the detective go to the apartment complex? So he could solve the staircase.
He worked it out with a pencil.