You correctly calculated the time it takes the sound to go from the
first submarine to the second one. The question is asking how long
the complete round-trip takes, that is, how long it takes for the first
submarine to hear the echo. So the total distance is 30km.