Masai Restaurant
EasyP3Coding
A manager serves food packages kept in a pile. You are given a list of queries in order. Each query is one of:
[1](customer): the package on top of the pile is handed out and its cost is reported. If the pile is empty, report"No Food"instead.[2, c](chef): a new package with costcis placed on top of the pile. Nothing is reported.
Return the reported results in order, as strings (costs as decimal strings).
Example 1
- Input
- queries = [[1],[2,5],[2,7],[1],[1],[1]]
- Output
- ["No Food","7","5","No Food"]
Constraints
- 1 <= queries.length <= 10^5
- 1 <= c <= 10^9
Hints
Give it a real attempt first. Run shows which examples fail.
Saved automatically
Run checks the 3 visible tests, Submit all 9. ⌘Enter runs, ⌘⇧Enter submits.