Thanks! :)
Nice to see someone else joining this little challenge, welcome! :)
That's really great you've got a working solution but I would encourage you to work on improving your code.
Some quick notes:
- regex isn't a good fit for such problem (look up what I've told William Parsons at...
Right, that's what I've mentioned above:
Absolutely. Let me try to wrap up some explanation below.
Relating to the algorithm above - good catch (working late at midnights sometimes cause such things :)). Seems like it should be something like this there instead:
const charFromStack =...
If you're interested in more technical explanation, below are some thoughts.
So, basically the algorithm to solve this problem should be doing something like this:
- create a stack
- traverse the string you have
- If the current character is a an opening bracket (‘(‘ or ‘[‘, etc...) then push...
That's good. Let's take a look.
Such coding tasks are targeting your knowledge of data structures and algorithms and this one is a perfect example of it. The main idea behind such tasks is to test your knowledge in this domain. It means you should be able to identify a correct data structure...
If you put it in the right place (between <head></head> tags in your html) and it's not being overwritten or removed somehow, it should work.
You sure, you're inserting the correct code? It should look like the line below:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.