What are the set of functions that are to be executed to get the following…

PYQ Goldman Sachs Hiring Assessment 2023

What are the set of functions that are to be executed to get the following output?

cat

  1. A.

    push(c, s); push(a, s); push(t, s); pop(s); pop(s); pop(s);

  2. B.

    push(c, s); pop(s); push(a, s); pop(s); push(t, s); pop(s);

  3. C.

    pop(c); pop(a); pop(t);

  4. D.

    push(c, s); push(a, s); pop(t);

Attempted by 211 students.

Sign up free to check your answer

Sign up free

Explore the full course: Coding For Placement

Loading lesson…