.
Let L be the one way distance.
Then you have this "time" equation to find L:
+
=
of an hour. (!)
It is "time" equation, because each fraction in the left side is the time to cover the distance L at the corresponding speed.
From equation (1), after multiplying its both sides by 24, you have
3L + L = 3*6, or
4L = 18 ====> L =
=
= 
= 4.5 km.
Check.
+
=
+
=
+
=
=
of an hour. ! Correct !
Solved.