/**
 * Given a string and a list of characters, remove all occurrences
 * of the characters from the string and create a tuple with the
 * remaining characters. Return the tuple.
 *
 * @param string The input string.
 * @param elementsToRemove The list of characters to remove.
 * @return A tuple containing the remaining characters.
 *
 * Example:
 * removeElementsAndCreateTuple("Hello world!", listOf('o', 'l'))
 * Output: ('e', 'h', ' ', 'w', 'r', 'd', '!')
 */
fun removeElementsAndCreateTuple(string: String, elementsToRemove: List<Char>): List<Char> {

    var cleanedString = string.toList()
    for (element in elementsToRemove) {
        cleanedString = cleanedString.filter { it != element }
    }
    return cleanedString
}
/**
 * Given a string and a list of characters, remove all occurrences
 * of the characters from the string and create a tuple with the
 * remaining characters. Return the tuple.
 *
 * @param string The input string.
 * @param elementsToRemove The list of characters to remove.
 * @return A tuple containing the remaining characters.
 *
 * Example:
 * removeElementsAndCreateTuple("Hello world!", listOf('o', 'l'))
 * Output: ('e', 'h', ' ', 'w', 'r', 'd', '!')
 */
fun removeElementsAndCreateTuple(string: String, elementsToRemove: List<Char>): List<Char> {
/**
 * Given a string and a list of characters, remove all occurrences
 * of the characters from the string and create a tuple with the
 * remaining characters. Return the tuple.
 *
 * @param string The input string.
 * @param elementsToRemove The list of characters to remove.
 * @return A tuple containing the remaining characters.
 *
 * Example:
 * removeElementsAndCreateTuple("Hello world!", listOf('o', 'l'))
 * Output: ('e', 'h', ' ', 'w', 'r', 'd', '!')
 */
fun removeElementsAndCreateTuple(string: String, elementsToRemove: List<Char>): List<Char> {

    var cleanedString = string.toList()
    for (element in elementsToRemove) {
        cleanedString = cleanedString.filter { it != element }
    }
    return cleanedString
}