Doubt in a stack question

Can someone pls explain what is “longest prefix” in the problem statement of COMPILER :slight_smile: . It is a stack based question

Assuming you meant the CodeChef problem, the longest prefix refers to the longest string of brackets from the start which make proper sense in Lira’s language. It may be possible that its length is 0. Also, note that its length will always be even. Hope that helps you.

Question link please.

1 Like

Thanks a ton!! :slight_smile:

Oh really sorry , I’m a newbie ,so forgot to add the link CodeChef: Practical coding for everyone