/**
 * Given a string and an element, appends the element to a list and creates a tuple from the modified string.
 *
 * @param text A string containing multiple words separated by spaces.
 * @param element A string representing the element to append to the list.
 * @return A tuple containing the modified string as the first element and the list with the appended element as the second element.
 */
fun appendElementsAndCreateTuple(text: String, element: String): Pair<String, List<String>> {

    // Split the string into a list of words
    val words = text.split(" ")

    // Append the element to the list
    words.toMutableList().add(element)

    // Create a pair from the modified string and the list
    val resultPair = Pair(text.replace(" ", ""), words)

    return resultPair
}
/**
 * Given a string and an element, appends the element to a list and creates a tuple from the modified string.
 *
 * @param text A string containing multiple words separated by spaces.
 * @param element A string representing the element to append to the list.
 * @return A tuple containing the modified string as the first element and the list with the appended element as the second element.
 */
fun appendElementsAndCreateTuple(text: String, element: String): Pair<String, List<String>> {
/**
 * Given a string and an element, appends the element to a list and creates a tuple from the modified string.
 *
 * @param text A string containing multiple words separated by spaces.
 * @param element A string representing the element to append to the list.
 * @return A tuple containing the modified string as the first element and the list with the appended element as the second element.
 */
fun appendElementsAndCreateTuple(text: String, element: String): Pair<String, List<String>> {

    // Split the string into a list of words
    val words = text.split(" ")

    // Append the element to the list
    words.toMutableList().add(element)

    // Create a pair from the modified string and the list
    val resultPair = Pair(text.replace(" ", ""), words)

    return resultPair
}