NeuroBlade Interview Question

check valid paranthesis in java