Akamai interview question

Stack simple problem