Frage im Vorstellungsgespräch bei Walmart Global Tech

Coding question which was solved by implementing a stack data structure.