/**
 * Given a list of integers 'elements' and an integer 'num', delete all elements in 'elements' that can be divided
 * by 'num' without any remainder. Then, assign the remaining elements to a new list and return it.
 *
 * Example:
 * ----------
 * Input:
 * elements = [10, 15, 20, 25, 30, 35]
 * num = 5
 *
 * Output:
 * [10, 20, 30]
 * ----------
 * Input:
 * elements = [11, 12, 13, 14, 15, 16, 17]
 * num = 6
 *
 * Output:
 * [11, 13, 14, 15, 17]
 */
fun deleteDivisionAssignment(elements: MutableList<Int>, num: Int): List<Int> {

    // Delete elements divisible by 'num'
    val iterator = elements.iterator()
    while (iterator.hasNext()) {
        val element = iterator.next()
        if (element % num == 0) {
            iterator.remove()
        }
    }

    // Assign remaining elements to new list
    val result = elements.toList()

    return result
}
/**
 * Given a list of integers 'elements' and an integer 'num', delete all elements in 'elements' that can be divided
 * by 'num' without any remainder. Then, assign the remaining elements to a new list and return it.
 *
 * Example:
 * ----------
 * Input:
 * elements = [10, 15, 20, 25, 30, 35]
 * num = 5
 *
 * Output:
 * [10, 20, 30]
 * ----------
 * Input:
 * elements = [11, 12, 13, 14, 15, 16, 17]
 * num = 6
 *
 * Output:
 * [11, 13, 14, 15, 17]
 */
fun deleteDivisionAssignment(elements: MutableList<Int>, num: Int): List<Int> {
/**
 * Given a list of integers 'elements' and an integer 'num', delete all elements in 'elements' that can be divided
 * by 'num' without any remainder. Then, assign the remaining elements to a new list and return it.
 *
 * Example:
 * ----------
 * Input:
 * elements = [10, 15, 20, 25, 30, 35]
 * num = 5
 *
 * Output:
 * [10, 20, 30]
 * ----------
 * Input:
 * elements = [11, 12, 13, 14, 15, 16, 17]
 * num = 6
 *
 * Output:
 * [11, 13, 14, 15, 17]
 */
fun deleteDivisionAssignment(elements: MutableList<Int>, num: Int): List<Int> {

    // Delete elements divisible by 'num'
    val iterator = elements.iterator()
    while (iterator.hasNext()) {
        val element = iterator.next()
        if (element % num == 0) {
            iterator.remove()
        }
    }

    // Assign remaining elements to new list
    val result = elements.toList()

    return result
}