/**
 * This exercise will test your knowledge of removing elements from a list using the 'break' statement.
 *
 * You are given a list 'lst' containing integers and a target number 'num'. Your task is to remove all
 * occurrences of the target number from the list using a 'break' statement.
 *
 * Your function should return the modified list with the target number removed.
 *
 * Example:
 * removeElements(listOf(1, 2, 3, 4, 1, 5, 6, 1), 1) -> [2, 3, 4, 5, 6]
 * removeElements(listOf(1, 1, 1, 1, 1), 1) -> []
 *
 * Remember:
 * - The 'break' statement is used to exit a loop prematurely.
 * - You can use the 'remove()' method to remove an element from the list.
 *
 * Good luck!
 */
fun removeElements(lst: MutableList<Int>, num: Int): List<Int> {

    for (i in lst) {
        if (i == num) {
            lst.remove(i)
            break  // Add the 'break' statement here to exit the loop after removing the first occurrence of num
        }
    }
    return lst
}
/**
 * This exercise will test your knowledge of removing elements from a list using the 'break' statement.
 *
 * You are given a list 'lst' containing integers and a target number 'num'. Your task is to remove all
 * occurrences of the target number from the list using a 'break' statement.
 *
 * Your function should return the modified list with the target number removed.
 *
 * Example:
 * removeElements(listOf(1, 2, 3, 4, 1, 5, 6, 1), 1) -> [2, 3, 4, 5, 6]
 * removeElements(listOf(1, 1, 1, 1, 1), 1) -> []
 *
 * Remember:
 * - The 'break' statement is used to exit a loop prematurely.
 * - You can use the 'remove()' method to remove an element from the list.
 *
 * Good luck!
 */
fun removeElements(lst: MutableList<Int>, num: Int): List<Int> {
/**
 * This exercise will test your knowledge of removing elements from a list using the 'break' statement.
 *
 * You are given a list 'lst' containing integers and a target number 'num'. Your task is to remove all
 * occurrences of the target number from the list using a 'break' statement.
 *
 * Your function should return the modified list with the target number removed.
 *
 * Example:
 * removeElements(listOf(1, 2, 3, 4, 1, 5, 6, 1), 1) -> [2, 3, 4, 5, 6]
 * removeElements(listOf(1, 1, 1, 1, 1), 1) -> []
 *
 * Remember:
 * - The 'break' statement is used to exit a loop prematurely.
 * - You can use the 'remove()' method to remove an element from the list.
 *
 * Good luck!
 */
fun removeElements(lst: MutableList<Int>, num: Int): List<Int> {

    for (i in lst) {
        if (i == num) {
            lst.remove(i)
            break  // Add the 'break' statement here to exit the loop after removing the first occurrence of num
        }
    }
    return lst
}