/**
 * Given a list of products and a list of categories, return a list of products that belong to all the categories.
 *
 * @param products A list of products (strings).
 * @param categories A list of categories (strings).
 * @return A list of products that belong to all the categories (strings).
 */
fun findProducts(products: List<String>, categories: List<String>): List<String> {

    val commonProducts = mutableListOf<String>()

    for (product in products) {
        var belongsToAllCategories = true

        for (category in categories) {
            if (!product.contains(category)) {
                belongsToAllCategories = false
                break
            }
        }

        if (belongsToAllCategories) {
            commonProducts.add(product)
        }
    }

    return commonProducts
}
/**
 * Given a list of products and a list of categories, return a list of products that belong to all the categories.
 *
 * @param products A list of products (strings).
 * @param categories A list of categories (strings).
 * @return A list of products that belong to all the categories (strings).
 */
fun findProducts(products: List<String>, categories: List<String>): List<String> {
/**
 * Given a list of products and a list of categories, return a list of products that belong to all the categories.
 *
 * @param products A list of products (strings).
 * @param categories A list of categories (strings).
 * @return A list of products that belong to all the categories (strings).
 */
fun findProducts(products: List<String>, categories: List<String>): List<String> {

    val commonProducts = mutableListOf<String>()

    for (product in products) {
        var belongsToAllCategories = true

        for (category in categories) {
            if (!product.contains(category)) {
                belongsToAllCategories = false
                break
            }
        }

        if (belongsToAllCategories) {
            commonProducts.add(product)
        }
    }

    return commonProducts
}