Two people climb to the roof of a building. The older person walked up a gentle ramp, the young person climbed up a steep spiral staircase. Which person did more work?
They both did the same amount of work against gravity. Work = force * displacement * cosine of angle between the two. Therefore only the vertical displacement, i.e., the height, matters.