Amazon Interview Question

Question that used a monotonic stack