MulticoreWare Interview Question

Check whether the given parentheses is valid or not