/**
 * Given an array and a list of indexes, this function deletes the elements at the given indexes from the array.
 *
 * @param array The original array.
 * @param indexes The indexes of the elements to be deleted.
 * @return The modified array after removing the elements at the specified indexes.
 */
fun deleteElementsFromList(array: MutableList<Any>, vararg indexes: Int): List<Any> {

    indexes.sortedDescending().forEach { index ->
        if (index >= 0 && index < array.size) {
            array.removeAt(index)
        }
    }
    return array
}
/**
 * Given an array and a list of indexes, this function deletes the elements at the given indexes from the array.
 *
 * @param array The original array.
 * @param indexes The indexes of the elements to be deleted.
 * @return The modified array after removing the elements at the specified indexes.
 */
fun deleteElementsFromList(array: MutableList<Any>, vararg indexes: Int): List<Any> {
/**
 * Given an array and a list of indexes, this function deletes the elements at the given indexes from the array.
 *
 * @param array The original array.
 * @param indexes The indexes of the elements to be deleted.
 * @return The modified array after removing the elements at the specified indexes.
 */
fun deleteElementsFromList(array: MutableList<Any>, vararg indexes: Int): List<Any> {

    indexes.sortedDescending().forEach { index ->
        if (index >= 0 && index < array.size) {
            array.removeAt(index)
        }
    }
    return array
}