Answer
a. 1.
b. 3.
Work Step by Step
For a particle in a cubical box, different values of $(n_x, n_y, n_z)$ can give the same energy.
a. $n_x^2+ n_y^2+n_z^2=3$. This only occurs for (1,1,1) so the degeneracy is 1.
b. $n_x^2+ n_y^2+n_z^2=9$. This occurs for (1,2,2), (2,1,2), and (2,2,1) so the degeneracy is 3.