/**
 * Given two lists of license plates, find the common license plates in both lists.
 *
 * @param licensePlates1 A list of license plates for the first scenario.
 * @param licensePlates2 A list of license plates for the second scenario.
 * @return A list of common license plates found in both scenarios.
 */
fun findCommonLicensePlates(licensePlates1: List<String>, licensePlates2: List<String>): List<String> {

    val commonLicensePlates = mutableListOf<String>()

    // Convert both lists to sets for efficient intersection operation
    val licensePlatesSet1 = licensePlates1.toSet()
    val licensePlatesSet2 = licensePlates2.toSet()

    // Find the intersection of both sets
    val commonLicensePlatesSet = licensePlatesSet1.intersect(licensePlatesSet2)

    // Convert the set back to a list for returning
    commonLicensePlates.addAll(commonLicensePlatesSet)

    return commonLicensePlates
}

val licensePlates1 = listOf("ABC123", "XYZ987", "DEF456", "PQR765", "MNO321")
val licensePlates2 = listOf("DEF456", "PQR765", "GHI654", "MNO321", "JKL876")
/**
 * Given two lists of license plates, find the common license plates in both lists.
 *
 * @param licensePlates1 A list of license plates for the first scenario.
 * @param licensePlates2 A list of license plates for the second scenario.
 * @return A list of common license plates found in both scenarios.
 */
fun findCommonLicensePlates(licensePlates1: List<String>, licensePlates2: List<String>): List<String> {
/**
 * Given two lists of license plates, find the common license plates in both lists.
 *
 * @param licensePlates1 A list of license plates for the first scenario.
 * @param licensePlates2 A list of license plates for the second scenario.
 * @return A list of common license plates found in both scenarios.
 */
fun findCommonLicensePlates(licensePlates1: List<String>, licensePlates2: List<String>): List<String> {

    val commonLicensePlates = mutableListOf<String>()

    // Convert both lists to sets for efficient intersection operation
    val licensePlatesSet1 = licensePlates1.toSet()
    val licensePlatesSet2 = licensePlates2.toSet()

    // Find the intersection of both sets
    val commonLicensePlatesSet = licensePlatesSet1.intersect(licensePlatesSet2)

    // Convert the set back to a list for returning
    commonLicensePlates.addAll(commonLicensePlatesSet)

    return commonLicensePlates
}

val licensePlates1 = listOf("ABC123", "XYZ987", "DEF456", "PQR765", "MNO321")
val licensePlates2 = listOf("DEF456", "PQR765", "GHI654", "MNO321", "JKL876")