/**
 * This exercise focuses on infinite loops and appending and removing elements in a fashion designer's wardrobe.
 *
 * Given a list of clothing items in the 'wardrobe' and the number of 'iterations' to run the loop,
 * the objective is to create an infinite loop that continuously appends and removes elements from the wardrobe.
 *
 * The loop should keep adding a new clothing item to the wardrobe and remove an existing item at each iteration.
 *
 * Your task is to complete the code by implementing the infinite loop.
 *
 * @param wardrobe A list of clothing items.
 * @param iterations The number of iterations to run the infinite loop.
 */
fun createInfiniteLoop(wardrobe: MutableList<String>, iterations: Int) {

    // Initialize an index variable to keep track of the current clothing item to remove
    var removeIdx = 0

    // Start the infinite loop
    while (true) {
        // Add a new clothing item to the wardrobe
        wardrobe.add("New Clothing Item")

        // Remove an existing clothing item from the wardrobe
        if (wardrobe.size > removeIdx) {
            wardrobe.removeAt(removeIdx)
        }

        // Print the updated wardrobe
        println(wardrobe)
    }
}
/**
 * This exercise focuses on infinite loops and appending and removing elements in a fashion designer's wardrobe.
 *
 * Given a list of clothing items in the 'wardrobe' and the number of 'iterations' to run the loop,
 * the objective is to create an infinite loop that continuously appends and removes elements from the wardrobe.
 *
 * The loop should keep adding a new clothing item to the wardrobe and remove an existing item at each iteration.
 *
 * Your task is to complete the code by implementing the infinite loop.
 *
 * @param wardrobe A list of clothing items.
 * @param iterations The number of iterations to run the infinite loop.
 */
fun createInfiniteLoop(wardrobe: MutableList<String>, iterations: Int) {
/**
 * This exercise focuses on infinite loops and appending and removing elements in a fashion designer's wardrobe.
 *
 * Given a list of clothing items in the 'wardrobe' and the number of 'iterations' to run the loop,
 * the objective is to create an infinite loop that continuously appends and removes elements from the wardrobe.
 *
 * The loop should keep adding a new clothing item to the wardrobe and remove an existing item at each iteration.
 *
 * Your task is to complete the code by implementing the infinite loop.
 *
 * @param wardrobe A list of clothing items.
 * @param iterations The number of iterations to run the infinite loop.
 */
fun createInfiniteLoop(wardrobe: MutableList<String>, iterations: Int) {

    // Initialize an index variable to keep track of the current clothing item to remove
    var removeIdx = 0

    // Start the infinite loop
    while (true) {
        // Add a new clothing item to the wardrobe
        wardrobe.add("New Clothing Item")

        // Remove an existing clothing item from the wardrobe
        if (wardrobe.size > removeIdx) {
            wardrobe.removeAt(removeIdx)
        }

        // Print the updated wardrobe
        println(wardrobe)
    }
}