/**
 * Given two lists, 'names' and 'years', this function returns a new list where each element is a concatenation of the name and year in the corresponding positions.
 *
 * @param names A list of names.
 * @param years A list of years.
 * @return A new list with the concatenation of names and years.
 */
fun concatenationLists(names: List<String>, years: List<Int>): List<String> {

    // Initialize an empty list to store the resulting concatenations
    val concatenations = mutableListOf<String>()

    // Check if the length of the names list is equal to the length of the years list
    if (names.size != years.size) {
        throw IllegalArgumentException("Both lists must have the same length.")
    }

    // Iterate over the indices of the lists
    for (i in names.indices) {
        // Concatenate the name and year at the current index
        val concatenation = "${names[i]}${years[i]}"

        // Append the concatenation to the result list
        concatenations.add(concatenation)
    }

    return concatenations
}
/**
 * Given two lists, 'names' and 'years', this function returns a new list where each element is a concatenation of the name and year in the corresponding positions.
 *
 * @param names A list of names.
 * @param years A list of years.
 * @return A new list with the concatenation of names and years.
 */
fun concatenationLists(names: List<String>, years: List<Int>): List<String> {
/**
 * Given two lists, 'names' and 'years', this function returns a new list where each element is a concatenation of the name and year in the corresponding positions.
 *
 * @param names A list of names.
 * @param years A list of years.
 * @return A new list with the concatenation of names and years.
 */
fun concatenationLists(names: List<String>, years: List<Int>): List<String> {

    // Initialize an empty list to store the resulting concatenations
    val concatenations = mutableListOf<String>()

    // Check if the length of the names list is equal to the length of the years list
    if (names.size != years.size) {
        throw IllegalArgumentException("Both lists must have the same length.")
    }

    // Iterate over the indices of the lists
    for (i in names.indices) {
        // Concatenate the name and year at the current index
        val concatenation = "${names[i]}${years[i]}"

        // Append the concatenation to the result list
        concatenations.add(concatenation)
    }

    return concatenations
}