Structuring the Document - Hacker Rank Solution
The true problem here is to write function from string. Let's write some assisting functions , and . They all will take some substring of the original string as a parameter. You can pass the substring itself, however, in order to save time and memory, two indices are recommended instead: the index of the original string where the substring begins and the index of the original string where the substring ends.