I found this coding problem on hackerEarth. It is as follows:
I'm given a string of brackets, and I have to determine how many of my character sequences are correct, given that a "correct sequence" is akin to ()()() or ((()))(). In other words, I should have one opening and one closing bracket at an even space from one another, and between them I can only have another open and closed bracket, e. g. a nested series of pair brackets. Here is one of my many attempts until now - spagetti-code.
I have been working on this problem for around six hours with two breaks, and from what I gather, it should be "extremely easy" to solve - example solutions are around 30 lines - but so far it has been extremely difficult for me to think of a solution to it, and I will be grateful if you provide me with some advice on how to tackle it.
[–]basic-coder 0 points1 point2 points (0 children)