/**
 * This function is used to update a collection with a new item.
 * The collection is a list containing the existing items.
 * The item is the new item to be added to the collection.
 * It should return the updated collection after adding the new item.
 */
fun updateCollection(collection: MutableList<Any>, item: Any): MutableList<Any> {

    // Iterate through each item in the collection
    for (i in collection.indices) {
        // Check if the item is equal to the current item in the collection
        if (item == collection[i]) {
            // Use a break statement here to terminate the loop and return the collection as it is
            break
        }
    }

    // Append the new item to the collection after the loop ends
    collection.add(item)

    // Return the updated collection
    return collection
}
/**
 * This function is used to update a collection with a new item.
 * The collection is a list containing the existing items.
 * The item is the new item to be added to the collection.
 * It should return the updated collection after adding the new item.
 */
fun updateCollection(collection: MutableList<Any>, item: Any): MutableList<Any> {
/**
 * This function is used to update a collection with a new item.
 * The collection is a list containing the existing items.
 * The item is the new item to be added to the collection.
 * It should return the updated collection after adding the new item.
 */
fun updateCollection(collection: MutableList<Any>, item: Any): MutableList<Any> {

    // Iterate through each item in the collection
    for (i in collection.indices) {
        // Check if the item is equal to the current item in the collection
        if (item == collection[i]) {
            // Use a break statement here to terminate the loop and return the collection as it is
            break
        }
    }

    // Append the new item to the collection after the loop ends
    collection.add(item)

    // Return the updated collection
    return collection
}