We have got a 3 x 9 x 5 cube. The dimension does not really matter.
Cut the cube into three layers – top, middle and bottom.
To get a hollow cube, we need the top and the bottom layer. From the middle layer, when we remove the core which is the unpainted cubes, we get the material for the hollow cube.
Initially we have 3 x 9 x 5 cubes = 135 small cubes . This forms the solid cube.
The top layer has 1 x 9 x 5 cubes = 45 cubes which are needed for the hollow cube. And like this we need the 45 cubes from the bottom also. \
In the middle layer, we have 45 cubes. But we do not need the core of the cube of dimension 1 x 7 x 3 = 21 cubes. We remove this from 45 to get 24 cubes.
Hence the total no. of cubes needed to make a hollow cube is =
45 + 45 + 24 = 114 cubes