/**
 * Given two lists of names, merge them into a single list by concatenating corresponding elements.
 * The resulting list should contain the full names in the order they appear in the original lists.
 *
 * @param firstNames List of first names.
 * @param lastNames List of last names.
 * @return Merged list containing full names.
 *
 * Example:
 * mergeNames(listOf("John", "Alice"), listOf("Doe", "Smith")) -> listOf("John Doe", "Alice Smith")
 */
fun mergeNames(firstNames: List<String>, lastNames: List<String>): List<String> {

    val mergedNames = mutableListOf<String>()
    for ((first, last) in firstNames.zip(lastNames)) {
        mergedNames.add("$first $last")
    }
    return mergedNames
}
/**
 * Given two lists of names, merge them into a single list by concatenating corresponding elements.
 * The resulting list should contain the full names in the order they appear in the original lists.
 *
 * @param firstNames List of first names.
 * @param lastNames List of last names.
 * @return Merged list containing full names.
 *
 * Example:
 * mergeNames(listOf("John", "Alice"), listOf("Doe", "Smith")) -> listOf("John Doe", "Alice Smith")
 */
fun mergeNames(firstNames: List<String>, lastNames: List<String>): List<String> {
/**
 * Given two lists of names, merge them into a single list by concatenating corresponding elements.
 * The resulting list should contain the full names in the order they appear in the original lists.
 *
 * @param firstNames List of first names.
 * @param lastNames List of last names.
 * @return Merged list containing full names.
 *
 * Example:
 * mergeNames(listOf("John", "Alice"), listOf("Doe", "Smith")) -> listOf("John Doe", "Alice Smith")
 */
fun mergeNames(firstNames: List<String>, lastNames: List<String>): List<String> {

    val mergedNames = mutableListOf<String>()
    for ((first, last) in firstNames.zip(lastNames)) {
        mergedNames.add("$first $last")
    }
    return mergedNames
}