LeetCode
Max Stack
Click
here
for an explanation.