/**
 * You are provided with a nurse's schedule, which is a list of pairs. Each pair contains the name of the nurse and their shift for a particular day.
 * Your task is to replace the names of the nurses with a code, which is formed by taking the first two letters of their name and appending the last two letters of their shift.
 * Return the modified nurse schedule list.
 * Example:
 * replaceElements(listOf(Pair("Emily", "Morning"), Pair("Peter", "Evening"), Pair("Olivia", "Night")))
 * Output: ["Emng", "Petr", "Ovia"]
 */
fun replaceElements(nurseSchedule: List<Pair<String, String>>): List<String> {

    // Using map and string operations
    return nurseSchedule.map { "${it.first.take(2)}${it.second.takeLast(2)}" }
}
/**
 * You are provided with a nurse's schedule, which is a list of pairs. Each pair contains the name of the nurse and their shift for a particular day.
 * Your task is to replace the names of the nurses with a code, which is formed by taking the first two letters of their name and appending the last two letters of their shift.
 * Return the modified nurse schedule list.
 * Example:
 * replaceElements(listOf(Pair("Emily", "Morning"), Pair("Peter", "Evening"), Pair("Olivia", "Night")))
 * Output: ["Emng", "Petr", "Ovia"]
 */
fun replaceElements(nurseSchedule: List<Pair<String, String>>): List<String> {
/**
 * You are provided with a nurse's schedule, which is a list of pairs. Each pair contains the name of the nurse and their shift for a particular day.
 * Your task is to replace the names of the nurses with a code, which is formed by taking the first two letters of their name and appending the last two letters of their shift.
 * Return the modified nurse schedule list.
 * Example:
 * replaceElements(listOf(Pair("Emily", "Morning"), Pair("Peter", "Evening"), Pair("Olivia", "Night")))
 * Output: ["Emng", "Petr", "Ovia"]
 */
fun replaceElements(nurseSchedule: List<Pair<String, String>>): List<String> {

    // Using map and string operations
    return nurseSchedule.map { "${it.first.take(2)}${it.second.takeLast(2)}" }
}