when Star 1 is 34 light years from Earth and Star 2 is 52 light years from Earth. that means the distance between star 1 and star 2 is 52-34 = 18 years so, If Star 2 explodes as a supernova so, the explosion would take 18 years to be seen from a planet orbiting Star 1.
The picture below shows the position of Earth and two stars.Star 1 is 34 light years from Earth and Star 2 is 52 light years from Earth. If Star 2 explodes as a supernova, I believe that A. 18 light years would pass before the explosion is seen from a planet orbiting Star 1. But I am not sure, sorry. :/