/**
 * Function to remove elements from a list that match a specific tuple.
 *
 * @param economistList The list of elements.
 * @param tupleToRemove The tuple of elements to be removed.
 * @return The updated list after removing the elements.
 */
fun removeTupleElements(economistList: MutableList<String>, tupleToRemove: List<String>): MutableList<String> {

    // Create a deep copy of the economistList to keep the original intact
    val updatedList = economistList.toMutableList()

    // Determine the length of the tuple to remove
    val tupleLength = tupleToRemove.size

    // Initialize the index variable
    var i = 0

    // Iterate through the list
    while (i < updatedList.size - tupleLength + 1) {
        // Check if the current sublist matches the tuple to remove
        if (updatedList.subList(i, i + tupleLength) == tupleToRemove) {
            // Remove the matching elements from the list
            updatedList.subList(i, i + tupleLength).clear()
            // Since elements are removed, update the index
            i -= tupleLength
        }
        // Increment the index
        i++
    }

    return updatedList
}
/**
 * Function to remove elements from a list that match a specific tuple.
 *
 * @param economistList The list of elements.
 * @param tupleToRemove The tuple of elements to be removed.
 * @return The updated list after removing the elements.
 */
fun removeTupleElements(economistList: MutableList<String>, tupleToRemove: List<String>): MutableList<String> {
/**
 * Function to remove elements from a list that match a specific tuple.
 *
 * @param economistList The list of elements.
 * @param tupleToRemove The tuple of elements to be removed.
 * @return The updated list after removing the elements.
 */
fun removeTupleElements(economistList: MutableList<String>, tupleToRemove: List<String>): MutableList<String> {

    // Create a deep copy of the economistList to keep the original intact
    val updatedList = economistList.toMutableList()

    // Determine the length of the tuple to remove
    val tupleLength = tupleToRemove.size

    // Initialize the index variable
    var i = 0

    // Iterate through the list
    while (i < updatedList.size - tupleLength + 1) {
        // Check if the current sublist matches the tuple to remove
        if (updatedList.subList(i, i + tupleLength) == tupleToRemove) {
            // Remove the matching elements from the list
            updatedList.subList(i, i + tupleLength).clear()
            // Since elements are removed, update the index
            i -= tupleLength
        }
        // Increment the index
        i++
    }

    return updatedList
}