/**
 * Given a nurse name and a list of names to delete, remove the specified names from the nurse's name and return
 * the concatenated string.
 *
 * @param nurseName The original nurse name.
 * @param namesToDelete A list of names to delete from the nurse's name.
 * @return The nurse's name after removing the specified names and concatenating the remaining parts.
 *
 * Example:
 * deleteAndConcatenate("NurseJoy", listOf("Jo")) -> "Nursey"
 * deleteAndConcatenate("NurseJoy", listOf("Nurse", "Joy")) -> ""
 */
fun deleteAndConcatenate(nurseName: String, namesToDelete: List<String>): String {

    var modifiedName = nurseName
    namesToDelete.forEach { name ->
        modifiedName = modifiedName.replace(name, "")
    }
    return modifiedName
}
/**
 * Given a nurse name and a list of names to delete, remove the specified names from the nurse's name and return
 * the concatenated string.
 *
 * @param nurseName The original nurse name.
 * @param namesToDelete A list of names to delete from the nurse's name.
 * @return The nurse's name after removing the specified names and concatenating the remaining parts.
 *
 * Example:
 * deleteAndConcatenate("NurseJoy", listOf("Jo")) -> "Nursey"
 * deleteAndConcatenate("NurseJoy", listOf("Nurse", "Joy")) -> ""
 */
fun deleteAndConcatenate(nurseName: String, namesToDelete: List<String>): String {
/**
 * Given a nurse name and a list of names to delete, remove the specified names from the nurse's name and return
 * the concatenated string.
 *
 * @param nurseName The original nurse name.
 * @param namesToDelete A list of names to delete from the nurse's name.
 * @return The nurse's name after removing the specified names and concatenating the remaining parts.
 *
 * Example:
 * deleteAndConcatenate("NurseJoy", listOf("Jo")) -> "Nursey"
 * deleteAndConcatenate("NurseJoy", listOf("Nurse", "Joy")) -> ""
 */
fun deleteAndConcatenate(nurseName: String, namesToDelete: List<String>): String {

    var modifiedName = nurseName
    namesToDelete.forEach { name ->
        modifiedName = modifiedName.replace(name, "")
    }
    return modifiedName
}