Create a program that takes an HTML string as input and checks if it is valid. The program should print true if the HTML is valid and false otherwise. Input: The input will be a string containing HTML tags. Output: The output will be true if the HTML is valid and false otherwise.
Example 1
Input: <html><body><h1>Hello World</h1></body></html>
Output: true
The program checks if the HTML is valid by matching all opening and closing tags
Constraints
Hints
Create a program that takes an HTML string as input and checks if it is valid. The program should print true if the HTML is valid and false otherwise. Input: The input will be a string containing HTML tags. Output: The output will be true if the HTML is valid and false otherwise.
Example 1
Input: <html><body><h1>Hello World</h1></body></html>
Output: true
The program checks if the HTML is valid by matching all opening and closing tags
Constraints
Hints