First, you measure the volume of the cuboid as a whole which is length x breadth x height, 9 x 12 x 18 = 1944 cm³. Then measure the volume occupied by the space, 3 x 3 x 18 since the hole runs along the entire length = 162 cm³.
Then you subtract the volume occupied by the hole from the volume of the cuboid in total, 1944 - 162 = 1782 cm³
This can be easily solved, especially with a calculator. With the calculator, you can find that is about 6.4807. Multiply that by 2, you get about 13 inches.
If you can't use a calculator, then you can just estimate. Since we know that is 6 and is 7, is in between them, so you can just say somewhere around 6.5.