Because the question assume frequency f depends on tension T, length L and mass per unit lemgth m
Assume the relation is f= T^{a}L^{b}m^{c}
The dimsnsion must be the same on either side of the equation
Dimension for f is 1/t
Dimenswion for T is M L /t^{2}, dimension for m is M/L
1/t = (M L /t^{2})^{a} L^{b} M/L^{c}=M^{a+c}L^{a+b}t^{-2a}
so -2a=-1 , a+c=0 and a+b=0