/**
 * This function updates the coordinates of an object on a number line representation.
 *
 * @param coordinates A list of coordinates representing the position of an object.
 * @param updates A list of tuples containing the update instructions.
 * @return The updated coordinates after applying the updates.
 */
fun updateCoordinates(coordinates: MutableList<Int>, updates: List<Pair<String, Int>>): List<Int> {

    for (update in updates) {
        when (update.first) {
            "add" -> coordinates.add(update.second)
            "remove" -> coordinates.remove(update.second)
            "shift_left" -> coordinates.replaceAll { it - update.second }
            "shift_right" -> coordinates.replaceAll { it + update.second }
        }
    }
    return coordinates
}
/**
 * This function updates the coordinates of an object on a number line representation.
 *
 * @param coordinates A list of coordinates representing the position of an object.
 * @param updates A list of tuples containing the update instructions.
 * @return The updated coordinates after applying the updates.
 */
fun updateCoordinates(coordinates: MutableList<Int>, updates: List<Pair<String, Int>>): List<Int> {
/**
 * This function updates the coordinates of an object on a number line representation.
 *
 * @param coordinates A list of coordinates representing the position of an object.
 * @param updates A list of tuples containing the update instructions.
 * @return The updated coordinates after applying the updates.
 */
fun updateCoordinates(coordinates: MutableList<Int>, updates: List<Pair<String, Int>>): List<Int> {

    for (update in updates) {
        when (update.first) {
            "add" -> coordinates.add(update.second)
            "remove" -> coordinates.remove(update.second)
            "shift_left" -> coordinates.replaceAll { it - update.second }
            "shift_right" -> coordinates.replaceAll { it + update.second }
        }
    }
    return coordinates
}