Hey Natalie,
So what is happening in part A where they are running in opposite directions is that the sum of their velocities (18+12=30 m/s) is what causing them to meet, because every second 30 meters are covered. So in 5 seconds 150 meters are covered in total, meaning the entire circumference has been ran and they meet.
In part two its the opposite, we take the difference of the velocities (18-12=6m/s) so as every second passes the slower of the two is 6 meters behind the other. So in 25 seconds (25*6=150) the slower will be 150 meters behind the faster of the two, and the faster will be 150 meters ahead of the slower of the two, AND the circumference of the circle is 150 meters so they will meet again on the circle.
I hope that helps I tried to take it as slow as possible there.