Let v be the running speed, so the walking speed is v−2. Time is distance over speed, and the two legs add to 5 hours:
v12+v−212=5
The excluded values are 0 and 2. Multiplying every term by the LCD v(v−2) gives 12(v−2)+12v=5v(v−2), so 5v2−34v+24=0 and (5v−4)(v−6)=0.
Both candidates, v=6 and v=54, are in the domain and satisfy the equation. But v=54 makes the walking speed 54−2, which is negative, so the story rejects it. She ran at 6 km/h, walked at 4 km/h, and the legs took 2 and 3 hours.