Length of wire required for solenoid to produce desired magnetic field

In a question:

To construct a solenoid, you wrap insulated wire uniformly around a plastic tube 12cm in diameter and 50cm in length. You would like a 2.2 A current to produce a 2.6 kG magnetic field inside your solenoid.

What is the total length of wire you will need to meet these specifications?

$$NC = nL C = (\frac{B}{\mu_0 I}) L (\pi d)$$

Where:

• $N$ is total number of turns
• $n$ is number of loops
• $C$ is circumference

But I dont understand why is there an $L$

I did it by:

$$B = \mu_0 n I$$

Then length of wire needed is just $nC$ whats wrong?

-

$n$ in this case isn't the number of loops, it's the number of loops per unit length. This is why you have to multiply it by $L$ to get $N$.