/**
 * This function finds the common elements between two arrays and returns them.
 * The arrays passed to this function should consist of ingredients used in a given recipe.
 */
fun findCommonElements(arr1: Array<String>, arr2: Array<String>): List<String> {

    // Use the built-in toSet() function to convert both arrays to sets
    val set1 = arr1.toSet()
    val set2 = arr2.toSet()

    // Use the built-in intersect() function to find the common elements between the two sets
    val commonElements = set1.intersect(set2)

    // Convert the commonElements set back to a list and return it
    return commonElements.toList()
}
/**
 * This function finds the common elements between two arrays and returns them.
 * The arrays passed to this function should consist of ingredients used in a given recipe.
 */
fun findCommonElements(arr1: Array<String>, arr2: Array<String>): List<String> {
/**
 * This function finds the common elements between two arrays and returns them.
 * The arrays passed to this function should consist of ingredients used in a given recipe.
 */
fun findCommonElements(arr1: Array<String>, arr2: Array<String>): List<String> {

    // Use the built-in toSet() function to convert both arrays to sets
    val set1 = arr1.toSet()
    val set2 = arr2.toSet()

    // Use the built-in intersect() function to find the common elements between the two sets
    val commonElements = set1.intersect(set2)

    // Convert the commonElements set back to a list and return it
    return commonElements.toList()
}