Arista Networks Interview Question

Algorithm: Check if the parenthesis are matching