Using linear thermal expansion formula we get,
[tex]\begin{gathered} \Delta L=\text{ }\alpha L_0L\Delta T \\ \Delta L=\text{ expansion in length;} \\ \alpha=\text{ coefficient of linear expansion;} \\ L_0=\text{ original length;} \\ L=\text{ expanded length;} \\ \Delta T=\text{ change in temperature ;} \end{gathered}[/tex]For aluminum rod
[tex]\begin{gathered} \Delta L_1=\text{ }\alpha_1\times5\times L_1\times50;\begin{cases}L={5\text{ m}} \\ \Delta T={70-20=50\degree C}\end{cases} \\ L_1=\text{ }\frac{\Delta L_1}{250\alpha_1};\text{ -------\lparen1\rparen} \end{gathered}[/tex]For nickel rod
[tex]\begin{gathered} \Delta L_2=\text{ }\alpha_2\times5\times L_2\times50; \\ L_2=\text{ }\frac{\Delta L_2}{250\alpha_2}\text{ -------\lparen2\rparen} \end{gathered}[/tex]Now equation( 1 ) - (2)
[tex]L_1-L_2=\frac{\Delta L_1\alpha_2-\Delta L_2\alpha_1}{250\alpha_1\alpha_2}[/tex]Above relation gives the final answer