/**
 * Given a list of numbers, this function modifies the elements in the list by adding 1 to each element that is divisible
 * by the given divisor and subtracting 1 from each element that is not divisible by the divisor.
 *
 * @param numbers A list of numbers.
 * @param divisor An integer divisor.
 * @return The modified list with updated elements.
 */
fun modifyListElements(numbers: List<Int>, divisor: Int): List<Int> {

    val modifiedList = mutableListOf<Int>()

    for (num in numbers) {
        if (num % divisor == 0) {
            modifiedList.add(num + 1)
        } else {
            modifiedList.add(num - 1)
        }
    }

    return modifiedList
}
/**
 * Given a list of numbers, this function modifies the elements in the list by adding 1 to each element that is divisible
 * by the given divisor and subtracting 1 from each element that is not divisible by the divisor.
 *
 * @param numbers A list of numbers.
 * @param divisor An integer divisor.
 * @return The modified list with updated elements.
 */
fun modifyListElements(numbers: List<Int>, divisor: Int): List<Int> {
/**
 * Given a list of numbers, this function modifies the elements in the list by adding 1 to each element that is divisible
 * by the given divisor and subtracting 1 from each element that is not divisible by the divisor.
 *
 * @param numbers A list of numbers.
 * @param divisor An integer divisor.
 * @return The modified list with updated elements.
 */
fun modifyListElements(numbers: List<Int>, divisor: Int): List<Int> {

    val modifiedList = mutableListOf<Int>()

    for (num in numbers) {
        if (num % divisor == 0) {
            modifiedList.add(num + 1)
        } else {
            modifiedList.add(num - 1)
        }
    }

    return modifiedList
}