Pandas: Solution with an implicit condition
About\nAn implicit condition in this task is that the problem does not specify that strings with more than two \'-\' characters should have everything between t
# About\nAn implicit condition in this task is that the problem does not specify that strings with more than two \'-\' characters should have everything between them **removed**\n\n---\n# Testcase\n```\n| content_id | content_text                    |\n| ---------- | ------------------------------- |\n| 1          | 1-ello world of SQL             |\n| 2          | he QUICK-brow-stopn-stop fox    |\n| 3          | modern-day DATA science         |\n| 4          | -eb-based FRONT-end development |\n```\n---\n# Complexity\n- Time complexity: $$O(n*m)$$, where $$n$$ - **quantity rows** in DataFrame, $$m$$ - **maximum length** str in **content_text**\n---\n# Code\n```python []\nimport pandas as pd\n\ndef capitalize_content(user_content: pd.DataFrame) -> pd.DataFrame:\n    def format_content(content: str) -> str:\n        # Initialize a new formatted string\n        formatted_content = \'\'\n        # Split the string by spaces\n        # (for better readability of the code)\n        for letter in content.split():\n            # Handle the case when the string is empty\n            # This can occur when there is more than one space between the words\n            if letter:\n                letter = letter.capitalize()\n                # We find the left index of the special character\n                special_letter = letter.find(\'-\')\n                if special_letter != -1:\n                    # Here, we select only the \'outer words\'\n                    # do this between the \'-\' character and in the \n                    # second line upercase letter\n                    letter = letter[:special_letter + 1] + letter[letter.rfind(\'-\') + 1:].capitalize()\n                formatted_content += letter + \' \'\n        # Remove the last space and return the string\n        return formatted_content[:-1]\n\n    # Call a custom function to create a new column\n    user_content.rename(columns={\'content_text\': \'original_text\'}, inplace=True)\n    user_content[\'converted_text\'] = user_content.original_text.apply(format_content)\n\n    return user_content\n\n```
['Pandas']