#K52022. SimpleML Text Analyzer

    ID: 29217 Type: Default 1000ms 256MiB

SimpleML Text Analyzer

SimpleML Text Analyzer

Given a text written in SimpleML, your task is to count the number of headers, paragraphs, and links in the text.

A header is defined as any line starting with the character #. A paragraph is a maximal block of consecutive non-empty lines (excluding header lines). Links are defined by the format \(\[text\]\(URL\)\), where the content inside the square brackets is clickable text and the parentheses enclose the URL.

Please note that a header line is not considered a paragraph. Use standard input (stdin) to read the entire text and output the three counts in order: headers, paragraphs, and links, separated by spaces on a single line.

inputFormat

The input consists of several lines representing a SimpleML document. Read all the input from stdin as one string. The text may include header lines (starting with '#'), paragraphs, and links in the format ([text](URL)).

outputFormat

Output three integers separated by a single space on one line representing the number of headers, paragraphs, and links found in the input text.## sample

#Header 1
This is a paragraph.

#Header 2
Another paragraph with a [link](http://example.com) in it.
2 2 1