Unable to solve COMPILER problem

Hi, I have been trying to solve the COMPILER problem. I am using the string as an array instead of using stack and queue. I have a suspicion that the reason my code is not working is because of else if condition in line 28. I could be wrong though.

Problem link here: CodeChef: Practical coding for everyone
Solution link here: CodeChef: Practical coding for everyone

Thanks for the help guys :slight_smile:

1 Like

Thanks a lot!

1 Like

Hi,

II tried solving it again but it is still giving a WA. I am getting the correct answer for << , <<> etc. Please help me regarding the same. Also, would love to know how to debug/generate test cases for the same. Do we need to think about every test case or is there some better way?

Problem link : CodeChef: Practical coding for everyone
Solution link: CodeChef: Practical coding for everyone

Thanks for the help!
Sidhant Dhar

Consider the test input:

1
<>>

I just generated an exhaustive list of all expressions with length \le 16 or so, along with the correct answer for each one.

1 Like