Check DOM test - proposal for a new exercise

Hello, is there already an exercise to check if a DOM is valid? I mean something like this: “Given a string representing a portion of html code, check if the html tags are nested correctly”. If not, I would like to submit this proposal. (Background: I have just submitted a programming test for a software company and the test required to write a function/method to check if the string was a valid html piece of code).

There’s “matching brackets” which is a very similar problem.

1 Like

you’re right. that problem helped me to practice recursion.

Recursion isn’t needed for either but both can be solved in a very similar manner.