/**
 * Given a list 'lst', an element 'element', and a value to compare 'compare',
 * this function appends the element to the list if the element is greater than or equal
 * to the compare value. Otherwise, it removes the element from the list.
 *
 * @param lst A list of elements.
 * @param element An element to add or remove from the list.
 * @param compare A value to compare the element with.
 * @return The modified list after appending or removing the element based on the comparison.
 *
 * Example:
 * modifyList(listOf(1, 2, 3, 4, 5), 3, 4) => [1, 2, 4, 5]
 */
fun modifyList(lst: MutableList<Int>, element: Int, compare: Int): List<Int> {

    // Append the element to the list if it is greater than or equal to the compare value
    if (element >= compare) {
        lst.add(element)
    } else if (element < compare) {
        lst.remove(element)
    }

    return lst
}
/**
 * Given a list 'lst', an element 'element', and a value to compare 'compare',
 * this function appends the element to the list if the element is greater than or equal
 * to the compare value. Otherwise, it removes the element from the list.
 *
 * @param lst A list of elements.
 * @param element An element to add or remove from the list.
 * @param compare A value to compare the element with.
 * @return The modified list after appending or removing the element based on the comparison.
 *
 * Example:
 * modifyList(listOf(1, 2, 3, 4, 5), 3, 4) => [1, 2, 4, 5]
 */
fun modifyList(lst: MutableList<Int>, element: Int, compare: Int): List<Int> {
/**
 * Given a list 'lst', an element 'element', and a value to compare 'compare',
 * this function appends the element to the list if the element is greater than or equal
 * to the compare value. Otherwise, it removes the element from the list.
 *
 * @param lst A list of elements.
 * @param element An element to add or remove from the list.
 * @param compare A value to compare the element with.
 * @return The modified list after appending or removing the element based on the comparison.
 *
 * Example:
 * modifyList(listOf(1, 2, 3, 4, 5), 3, 4) => [1, 2, 4, 5]
 */
fun modifyList(lst: MutableList<Int>, element: Int, compare: Int): List<Int> {

    // Append the element to the list if it is greater than or equal to the compare value
    if (element >= compare) {
        lst.add(element)
    } else if (element < compare) {
        lst.remove(element)
    }

    return lst
}