Walmart Global Tech interview question

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