/**
 * Given two lists of years, returns the common years between them.
 *
 * @param years1 The first list of years
 * @param years2 The second list of years
 * @return The list of common years between years1 and years2
 */
fun findCommonYears(years1: List<Int>, years2: List<Int>): List<Int> {

    val commonYears = mutableListOf<Int>()

    // Iterate over each year in years1
    for (year1 in years1) {
        // Iterate over each year in years2
        for (year2 in years2) {
            // If the year in years1 is equal to the year in years2
            if (year1 == year2) {
                // Add the common year to the list
                commonYears.add(year1)
                // Break the loop to avoid duplicate entries
                break
            }
        }
    }

    return commonYears
}
/**
 * Given two lists of years, returns the common years between them.
 *
 * @param years1 The first list of years
 * @param years2 The second list of years
 * @return The list of common years between years1 and years2
 */
fun findCommonYears(years1: List<Int>, years2: List<Int>): List<Int> {
/**
 * Given two lists of years, returns the common years between them.
 *
 * @param years1 The first list of years
 * @param years2 The second list of years
 * @return The list of common years between years1 and years2
 */
fun findCommonYears(years1: List<Int>, years2: List<Int>): List<Int> {

    val commonYears = mutableListOf<Int>()

    // Iterate over each year in years1
    for (year1 in years1) {
        // Iterate over each year in years2
        for (year2 in years2) {
            // If the year in years1 is equal to the year in years2
            if (year1 == year2) {
                // Add the common year to the list
                commonYears.add(year1)
                // Break the loop to avoid duplicate entries
                break
            }
        }
    }

    return commonYears
}