As we can assume the relationship is directly proportional, we have to build the proportion and do the cross product. So:
[tex]\begin{gathered} \frac{12cm}{\text{2 nights}}=\frac{18cm}{x\text{ nights}} \\ 12x=2\cdot18 \\ 12x=36 \\ x=\frac{36}{12} \\ x=3 \end{gathered}[/tex]She needs 3 nights