Distance = 120 km.
Time taken = 6 hours.
Speed of car starting fromA=120/6.
Speed of car starting from B=distance/speed of car starting from A.
The above solution is for same direction.
Time taken = 4320 seconds.
Speed of both the cars= 120000/4320.
The speed is same because they are in opposite direction.