/**
 * This exercise is designed for a biologist to practice accessing elements in a list and performing set operations.
 * Given two lists, the function 'commonElements' should return a new list that contains only the common elements
 * between the two input lists.
 *
 * @param list1 A list containing biological elements.
 * @param list2 Another list containing biological elements.
 * @return A list of common elements between list1 and list2.
 */
fun commonElements(list1: List<String>, list2: List<String>): List<String> {

    // Converting list1 into a set for set operations
    val set1 = list1.toSet()

    // Converting list2 into a set for set operations
    val set2 = list2.toSet()

    // Performing set intersection to get common elements
    val commonElements = set1.intersect(set2).toList()

    return commonElements
}
/**
 * This exercise is designed for a biologist to practice accessing elements in a list and performing set operations.
 * Given two lists, the function 'commonElements' should return a new list that contains only the common elements
 * between the two input lists.
 *
 * @param list1 A list containing biological elements.
 * @param list2 Another list containing biological elements.
 * @return A list of common elements between list1 and list2.
 */
fun commonElements(list1: List<String>, list2: List<String>): List<String> {
/**
 * This exercise is designed for a biologist to practice accessing elements in a list and performing set operations.
 * Given two lists, the function 'commonElements' should return a new list that contains only the common elements
 * between the two input lists.
 *
 * @param list1 A list containing biological elements.
 * @param list2 Another list containing biological elements.
 * @return A list of common elements between list1 and list2.
 */
fun commonElements(list1: List<String>, list2: List<String>): List<String> {

    // Converting list1 into a set for set operations
    val set1 = list1.toSet()

    // Converting list2 into a set for set operations
    val set2 = list2.toSet()

    // Performing set intersection to get common elements
    val commonElements = set1.intersect(set2).toList()

    return commonElements
}