/**
 * This function takes two arrays of locations, geographer1 and geographer2, and finds the common locations
 * between the two arrays using the 'in' operator. It returns a new array containing the common locations.
 *
 * @param geographer1 Array of locations of the first geographer
 * @param geographer2 Array of locations of the second geographer
 * @return Array containing the common locations between geographer1 and geographer2
 */
fun findCommonLocations(geographer1: Array<String>, geographer2: Array<String>): Array<String> {

    val commonLocations = mutableListOf<String>()

    // Iterate through each location in geographer1
    for (location1 in geographer1) {
        // Iterate through each location in geographer2
        for (location2 in geographer2) {
            // Check if location1 is present in geographer2, using the 'in' operator
            if (location1 in geographer2) {
                // Check if location2 is present in commonLocations, using the 'in' operator
                if (location2 !in commonLocations) {
                    // Append location2 to commonLocations
                    commonLocations.add(location2)
                }
            }
        }
    }

    return commonLocations.toTypedArray()
}
/**
 * This function takes two arrays of locations, geographer1 and geographer2, and finds the common locations
 * between the two arrays using the 'in' operator. It returns a new array containing the common locations.
 *
 * @param geographer1 Array of locations of the first geographer
 * @param geographer2 Array of locations of the second geographer
 * @return Array containing the common locations between geographer1 and geographer2
 */
fun findCommonLocations(geographer1: Array<String>, geographer2: Array<String>): Array<String> {
/**
 * This function takes two arrays of locations, geographer1 and geographer2, and finds the common locations
 * between the two arrays using the 'in' operator. It returns a new array containing the common locations.
 *
 * @param geographer1 Array of locations of the first geographer
 * @param geographer2 Array of locations of the second geographer
 * @return Array containing the common locations between geographer1 and geographer2
 */
fun findCommonLocations(geographer1: Array<String>, geographer2: Array<String>): Array<String> {

    val commonLocations = mutableListOf<String>()

    // Iterate through each location in geographer1
    for (location1 in geographer1) {
        // Iterate through each location in geographer2
        for (location2 in geographer2) {
            // Check if location1 is present in geographer2, using the 'in' operator
            if (location1 in geographer2) {
                // Check if location2 is present in commonLocations, using the 'in' operator
                if (location2 !in commonLocations) {
                    // Append location2 to commonLocations
                    commonLocations.add(location2)
                }
            }
        }
    }

    return commonLocations.toTypedArray()
}