{"id":22847662,"url":"https://github.com/maikelsouza/tagcontentextractor","last_synced_at":"2026-02-13T23:32:01.592Z","repository":{"id":267446643,"uuid":"901273699","full_name":"maikelsouza/TagContentExtractor","owner":"maikelsouza","description":"HackerRank Home Website Tag Content Extractor Test Solution","archived":false,"fork":false,"pushed_at":"2024-12-13T11:25:25.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-21T06:47:15.387Z","etag":null,"topics":["java-11","junit5"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/maikelsouza.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-10T11:04:18.000Z","updated_at":"2024-12-13T11:25:29.000Z","dependencies_parsed_at":"2025-05-07T03:42:57.181Z","dependency_job_id":null,"html_url":"https://github.com/maikelsouza/TagContentExtractor","commit_stats":null,"previous_names":["maikelsouza/tagcontentextractor"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maikelsouza/TagContentExtractor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maikelsouza%2FTagContentExtractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maikelsouza%2FTagContentExtractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maikelsouza%2FTagContentExtractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maikelsouza%2FTagContentExtractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maikelsouza","download_url":"https://codeload.github.com/maikelsouza/TagContentExtractor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maikelsouza%2FTagContentExtractor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276204835,"owners_count":25602738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java-11","junit5"],"created_at":"2024-12-13T04:08:47.574Z","updated_at":"2025-09-21T06:47:16.250Z","avatar_url":"https://github.com/maikelsouza.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tag-Based Language Parser\n\nIn a tag-based language like XML or HTML, contents are enclosed between a start tag and an end tag like `\u003ctag\u003econtents\u003c/tag\u003e`. Note that the corresponding end tag starts with a `/`.\n\nGiven a string of text in a tag-based language, parse this text and retrieve the contents enclosed within sequences of well-organized tags meeting the following criteria:\n\n1. The name of the start and end tags must be the same. The HTML code `\u003ch1\u003eHello World\u003c/h2\u003e` is not valid, because the text starts with an `h1` tag and ends with a non-matching `h2` tag.\n\n2. Tags can be nested, but content between nested tags is considered not valid. For example, in `\u003ch1\u003e\u003ca\u003econtents\u003c/a\u003einvalid\u003c/h1\u003e`, `contents` is valid but `invalid` is not valid.\n\n3. Tags can consist of any printable characters.\n\n## Input Format\n\n- The first line of input contains a single integer, `N` (the number of lines).\n- The `N` subsequent lines each contain a line of text.\n\n## Constraints\n\n- \\( 1 \\leq N \\leq 100 \\)\n- Each line contains a maximum of \\( 10^4 \\) printable characters.\n- The total number of characters in all test cases will not exceed \\( 10^6 \\).\n\n## Output Format\n\nFor each line, print the content enclosed within valid tags.\n\n- If a line contains multiple instances of valid content, print out each instance of valid content on a new line.\n- If no valid content is found, print `None`.\n\n## Sample Input\n\n```4```\\\n```\u003ch1\u003eNayeem loves counseling\u003c/h1\u003e```\\\n```\u003ch1\u003e\u003ch1\u003eSanjay has no watch\u003c/h1\u003e\u003c/h1\u003e\u003cpar\u003eSo wait for a while\u003c/par\u003e```\\\n```\u003cAmee\u003esafat codes like a ninja\u003c/amee\u003e```\\\n```\u003cSA premium\u003eImtiaz has a secret crush\u003c/SA premium\u003e```\n\n## Sample Output\n\n```Nayeem loves counseling```\\\n```Sanjay has no watch```\\\n```So wait for a while```\\\n```None```\\\n```Imtiaz has a secret crush```\n\n\n# Solution\n### The solution is implemented in the \u003ca rel=\"stylesheet\" href=\"https://github.com/maikelsouza/TagContentExtractor/blob/main/src/main/java/com/qikserve/tagContentExtractor/Solution.java\"\u003eSolution.java\u003c/a\u003e class\n\n# Test\n### You can run the test class \u003ca rel=\"stylesheet\" href=\"https://github.com/maikelsouza/TagContentExtractor/blob/main/src/test/java/com/qikserve/tagContentExtractor/SolutionTest.java\"\u003eSolutionTest.java\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaikelsouza%2Ftagcontentextractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaikelsouza%2Ftagcontentextractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaikelsouza%2Ftagcontentextractor/lists"}