/**
 * This function takes in the name of a chef and a recipe and returns a set
 * of common letters between the two.
 *
 * @param chef The name of the chef.
 * @param recipe The recipe to be matched with the chef's name.
 * @return A set of common letters between the chef's name and the recipe.
 */
fun commonLetters(chef: String, recipe: String): Set<String> {

    // Convert the chef's name and recipe to lowercase to ignore case sensitivity
    val chefLower = chef.toLowerCase()
    val recipeLower = recipe.toLowerCase()

    // Slice the chef's name into chunks of size 3
    val chefSlices = (0 until chefLower.length - 2).map { chefLower.substring(it, it + 3) }

    // Slice the recipe into chunks of size 2
    val recipeSlices = (0 until recipeLower.length - 1).map { recipeLower.substring(it, it + 2) }

    // Find the common letters between the chef's name and the recipe
    val commonLetters = chefSlices.toSet() intersect recipeSlices.toSet()

    return commonLetters
}
/**
 * This function takes in the name of a chef and a recipe and returns a set
 * of common letters between the two.
 *
 * @param chef The name of the chef.
 * @param recipe The recipe to be matched with the chef's name.
 * @return A set of common letters between the chef's name and the recipe.
 */
fun commonLetters(chef: String, recipe: String): Set<String> {
/**
 * This function takes in the name of a chef and a recipe and returns a set
 * of common letters between the two.
 *
 * @param chef The name of the chef.
 * @param recipe The recipe to be matched with the chef's name.
 * @return A set of common letters between the chef's name and the recipe.
 */
fun commonLetters(chef: String, recipe: String): Set<String> {

    // Convert the chef's name and recipe to lowercase to ignore case sensitivity
    val chefLower = chef.toLowerCase()
    val recipeLower = recipe.toLowerCase()

    // Slice the chef's name into chunks of size 3
    val chefSlices = (0 until chefLower.length - 2).map { chefLower.substring(it, it + 3) }

    // Slice the recipe into chunks of size 2
    val recipeSlices = (0 until recipeLower.length - 1).map { recipeLower.substring(it, it + 2) }

    // Find the common letters between the chef's name and the recipe
    val commonLetters = chefSlices.toSet() intersect recipeSlices.toSet()

    return commonLetters
}