You can
put this solution on YOUR website!
Let David's time be given as t.
Then Carl's time is t-30.

When Carl catches Dave, their distances are the same
that 300 is in minutes
So 5 hours in, they are both 18*300 = 20*270 = 5400 feet on their way.
FYI - climbing a mile in 5 hours is 'hiking'
Your answer is correct as far as you took it. You just have the units wrong. Your answer is time ... not distance. Your answer says Carl was hiking for 270 minutes .. not 270 feet.
Dave left 30 minutes earlier, so he has walked 300 minutes (same as my answer)
To convert time to distance, use
You can
put this solution on YOUR website!
the difference in speed 20-18=2
so he will gain 2 ft/min
or 270 min to meet
you just need to go a little further
270 min * 20 ft/min=5400 ft up the mountain
270 min * 18 ft/min=4860 ft + 540 ft ahead=5400 ft up mountain