/**
 * Deletes a product from the given product list.
 *
 * @param productList A list of product names.
 * @param productName The name of the product to be deleted.
 * @return The updated product list with the product removed.
 *
 * Example:
 * deleteProduct(listOf("Apple", "Banana", "Orange"), "Banana") // Output: ["Apple", "Orange"]
 */
fun deleteProduct(productList: MutableList<String>, productName: String): List<String> {

    val iterator = productList.iterator()
    while (iterator.hasNext()) {
        if (iterator.next() == productName) {
            iterator.remove()
        }
    }
    return productList
}
/**
 * Deletes a product from the given product list.
 *
 * @param productList A list of product names.
 * @param productName The name of the product to be deleted.
 * @return The updated product list with the product removed.
 *
 * Example:
 * deleteProduct(listOf("Apple", "Banana", "Orange"), "Banana") // Output: ["Apple", "Orange"]
 */
fun deleteProduct(productList: MutableList<String>, productName: String): List<String> {
/**
 * Deletes a product from the given product list.
 *
 * @param productList A list of product names.
 * @param productName The name of the product to be deleted.
 * @return The updated product list with the product removed.
 *
 * Example:
 * deleteProduct(listOf("Apple", "Banana", "Orange"), "Banana") // Output: ["Apple", "Orange"]
 */
fun deleteProduct(productList: MutableList<String>, productName: String): List<String> {

    val iterator = productList.iterator()
    while (iterator.hasNext()) {
        if (iterator.next() == productName) {
            iterator.remove()
        }
    }
    return productList
}