Skip to content
Onsite

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 cost c is 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

Run checks the 3 visible tests, Submit all 9.