you will get the same answer by using any of the equation
In one case the constant is R which is equal to RH/hc
Basic equation is E= RH(1/n^)2- 1/n^2_2)
and E = hc/λ If you plug in the values
then 1/λ= RH/hc(1/n^2_1-n^2_2)
so basically they are the same equation and R = RH/hc
RH is the Rydberg constant with units of J
and R is the Rydberg constant with units of m^-1