Solution Of Compilers and Parsers

Hi,
CodeChef: Practical coding for everyone this is my solution for the compilers problem of week 2 of DSA Learning Series. Can someone point out the mistake in my approach? I feel like my logic is correct but for some reason, it is not accepting my solution.