/**
 * This function removes the specified elements from a list and returns the modified list.
 *
 * @param list The list from which elements will be removed.
 * @param elementsToRemove The set containing elements to be removed.
 * @return The modified list without the specified elements.
 *
 * Example:
 * removeElementsFromList(listOf(1, 2, 3, 4, 5), setOf(2, 4)) // [1, 3, 5]
 */
fun removeElementsFromList(list: MutableList<Int>, elementsToRemove: Set<Int>): List<Int> {

    elementsToRemove.forEach { element ->
        if (element in list) {
            list.remove(element)
        }
    }
    return list
}
/**
 * This function removes the specified elements from a list and returns the modified list.
 *
 * @param list The list from which elements will be removed.
 * @param elementsToRemove The set containing elements to be removed.
 * @return The modified list without the specified elements.
 *
 * Example:
 * removeElementsFromList(listOf(1, 2, 3, 4, 5), setOf(2, 4)) // [1, 3, 5]
 */
fun removeElementsFromList(list: MutableList<Int>, elementsToRemove: Set<Int>): List<Int> {
/**
 * This function removes the specified elements from a list and returns the modified list.
 *
 * @param list The list from which elements will be removed.
 * @param elementsToRemove The set containing elements to be removed.
 * @return The modified list without the specified elements.
 *
 * Example:
 * removeElementsFromList(listOf(1, 2, 3, 4, 5), setOf(2, 4)) // [1, 3, 5]
 */
fun removeElementsFromList(list: MutableList<Int>, elementsToRemove: Set<Int>): List<Int> {

    elementsToRemove.forEach { element ->
        if (element in list) {
            list.remove(element)
        }
    }
    return list
}