/**
 * Given two lists of names, find and return a new list containing the names that are present in both lists.
 */
fun getCommonNames(names1: List<String>, names2: List<String>): List<String> {

    val commonNames = mutableListOf<String>()

    for (name in names1) {
        // Check if the current name is also present in the names2 list
        if (name in names2) {
            // Add the current name to the commonNames list
            commonNames.add(name)
        }
    }

    return commonNames
}
/**
 * Given two lists of names, find and return a new list containing the names that are present in both lists.
 */
fun getCommonNames(names1: List<String>, names2: List<String>): List<String> {
/**
 * Given two lists of names, find and return a new list containing the names that are present in both lists.
 */
fun getCommonNames(names1: List<String>, names2: List<String>): List<String> {

    val commonNames = mutableListOf<String>()

    for (name in names1) {
        // Check if the current name is also present in the names2 list
        if (name in names2) {
            // Add the current name to the commonNames list
            commonNames.add(name)
        }
    }

    return commonNames
}