Mini Scope Interpreter

PHP Hard 6 views
Back to Questions

Problem Description

Commands: BEGIN, END, SET name value, GET name. GET searches inner to outer. Print value or NOT_FOUND.

Input Format

First line q. Next q lines.

Output Format

Outputs for GET.

Sample Test Case

Input:
9 SET a 1 BEGIN GET a SET a 2 GET a END GET a GET b END
Output:
1 2 1 NOT_FOUND

Constraints

q

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next