For part a), I would assume ##\vec B## is uniform within the solenoid and zero outside of it. If you place a rectangular Amperian loop ##\partial \Sigma## with corners ##a, b, c, d## along a cross section of this ideal solenoid, the left side of Ampere's law will give:
$$\oint_{\partial \Sigma} \vec B \cdot d \vec S = \int_a^b \vec B \cdot d \vec S + \int_b^c \vec B \cdot d \vec S + \int_c^d \vec B \cdot d \vec S + \int_d^a \vec B \cdot d \vec S$$
The first integral yields:
$$\int_a^b \vec B \cdot d \vec S = B \int_a^b dS = BL$$
Where ##B = |\vec B|## and ##L## is the length of ##\partial \Sigma## from ##a## to ##b##.
The third integral is taken along a segment of ##\partial \Sigma##, which lies outside of the solenoid. The magnetic field outside the solenoid is zero, hence the integral is zero.
The second and fourth integrals work out to zero because ##\vec B## is either orthogonal to ##d \vec S##, or is equal to zero outside of the solenoid.
Hence we can write:
$$\oint_{\partial \Sigma} \vec B \cdot d \vec S = BL$$
Now using the right side of Ampere's law:
$$BL = \mu_0 i_{enc}$$
The loop ##\partial \Sigma## encloses ##nL## turns where ##n## is the number of turns per unit length of the solenoid. Using this, the enclosed current can be re-written as:
$$i_{enc} = inL$$
Where ##i## is the actual current in the solenoid windings. Hence we can write:
$$BL = \mu_0 inL$$
$$B = \mu_0 in$$
$$B = \mu_0 iN_1$$
This is the magnetic field inside the solenoid.