We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I don't like this challenge. It has at least three (!) unstated constraints on the input:
the content can not be an empty string
the tag name can not be an empty string
tags itself can not be content in all cases
To make clear what I mean, let me show you how the outputs should look like according to the challenge rules.
Empty content:
input:
<a></a>
output:
So an empty line instead of None.
Empty tag name:
input:
<>abc</>
output:
abc
So abc and instead of None.
Tags as content:
input:
<a>...</a>...</a>
output:
......</a>...
So two lines instead of one. In the first line the first </a> is interpreted as closing tag. In the second line the first </a> is interpreted as part of the content and the second as closing tag.
Please repair this challenge.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Tag Content Extractor
You are viewing a single comment's thread. Return to all comments →
I don't like this challenge. It has at least three (!) unstated constraints on the input:
To make clear what I mean, let me show you how the outputs should look like according to the challenge rules.
Empty content:
input:
output:
So an empty line instead of
None
.Empty tag name:
input:
output:
abc
So
abc
and instead ofNone
.Tags as content:
input:
output:
So two lines instead of one. In the first line the first
</a>
is interpreted as closing tag. In the second line the first</a>
is interpreted as part of the content and the second as closing tag.Please repair this challenge.