Help Required in Matched Brackets 2 Problem

Hello guys ,

I was solving this ZCO problem ( Matched Brackets 2 ) :

And I was getting WA , and even after checking for many examples myself in my IDE I am not able to find any fault in this code

My code :

Can someone plsss help me figure out where I am wrong ?

Thanks a lot !
Sudheera Y S