Ramp interview question

It was a leetcode stack problem