Pregunta de entrevista de Amazon

string and monotonic stack problems and queries