Amazon interview question

Question that used a monotonic stack