/**
 * Given a list of products represented as nested tuples and a tuple of interesting keywords,
 * this function returns a list of products that contain any of the interesting keywords.
 *
 * @param productList A nested tuple representing products. Each product is represented as a tuple
 *                    with three elements: (product_name, product_description, product_price).
 * @param interestingKeywords A tuple of interesting keywords.
 * @return A list of products containing any of the interesting keywords.
 */
fun findInterestingProducts(productList: List<Triple<String, String, Double>>, interestingKeywords: List<String>): List<Triple<String, String, Double>> {

    // List to store the interesting products
    val interestingProducts = mutableListOf<Triple<String, String, Double>>()

    // Iterate through each product
    for (product in productList) {
        // Unpack the product tuple
        val (productName, productDescription, productPrice) = product

        // Check if any of the interesting keywords are present in the product name or description
        if (interestingKeywords.any { keyword ->
            keyword.toLowerCase() in productName.toLowerCase() || keyword.toLowerCase() in productDescription.toLowerCase()
        }) {
            // Add the product to the list of interesting products
            interestingProducts.add(product)
        }
    }

    return interestingProducts
}
/**
 * Given a list of products represented as nested tuples and a tuple of interesting keywords,
 * this function returns a list of products that contain any of the interesting keywords.
 *
 * @param productList A nested tuple representing products. Each product is represented as a tuple
 *                    with three elements: (product_name, product_description, product_price).
 * @param interestingKeywords A tuple of interesting keywords.
 * @return A list of products containing any of the interesting keywords.
 */
fun findInterestingProducts(productList: List<Triple<String, String, Double>>, interestingKeywords: List<String>): List<Triple<String, String, Double>> {
/**
 * Given a list of products represented as nested tuples and a tuple of interesting keywords,
 * this function returns a list of products that contain any of the interesting keywords.
 *
 * @param productList A nested tuple representing products. Each product is represented as a tuple
 *                    with three elements: (product_name, product_description, product_price).
 * @param interestingKeywords A tuple of interesting keywords.
 * @return A list of products containing any of the interesting keywords.
 */
fun findInterestingProducts(productList: List<Triple<String, String, Double>>, interestingKeywords: List<String>): List<Triple<String, String, Double>> {

    // List to store the interesting products
    val interestingProducts = mutableListOf<Triple<String, String, Double>>()

    // Iterate through each product
    for (product in productList) {
        // Unpack the product tuple
        val (productName, productDescription, productPrice) = product

        // Check if any of the interesting keywords are present in the product name or description
        if (interestingKeywords.any { keyword ->
            keyword.toLowerCase() in productName.toLowerCase() || keyword.toLowerCase() in productDescription.toLowerCase()
        }) {
            // Add the product to the list of interesting products
            interestingProducts.add(product)
        }
    }

    return interestingProducts
}