Push 1,2 then Pop and print.
Ready — edit the code above and click Run.
using System;
class Program
{
static void Main()
{
using System.Collections.Generic;
var st = new Stack<int>();
st.Push(1); st.Push(2);
Console.WriteLine(st.Pop());
}
}
Try solving on your own first, then reveal the official answer.
Stack is Last-In-First-Out—used for bracket matching.