To solve this problem you need to draw a picture of 2 trajectories and find the angle between them. After you calculate the angle between them, you use cosine theorem to determine distance from starting to ending point.
In this case, the angle between 2 trajectories is exactly 90 degrees, so therefore we can use Pythagoras theorem (you will get the same result using cosine theorem):


answer is 159 km