/**
 * Given two lists of patients assigned to two different nurses, finds the uncommon patients
 * assigned to the two nurses, i.e., patients who are under the care of one nurse but not the other.
 *
 * @param nurse1 List of patients assigned to Nurse 1.
 * @param nurse2 List of patients assigned to Nurse 2.
 * @return A list of patients who are assigned to either Nurse 1 or Nurse 2 but not both.
 *
 * Example:
 * nurse1 = listOf("John", "Adam", "Emma", "Kevin", "Julia")
 * nurse2 = listOf("Adam", "Emma", "Liam", "Sophia")
 * findUncommonPatients(nurse1, nurse2) // Output: ["John", "Kevin", "Julia", "Liam", "Sophia"]
 */
fun findUncommonPatients(nurse1: List<String>, nurse2: List<String>): List<String> {

    val uncommonPatients = (nurse1.filter { it !in nurse2 } + nurse2.filter { it !in nurse1 }).distinct()
    return uncommonPatients
}
/**
 * Given two lists of patients assigned to two different nurses, finds the uncommon patients
 * assigned to the two nurses, i.e., patients who are under the care of one nurse but not the other.
 *
 * @param nurse1 List of patients assigned to Nurse 1.
 * @param nurse2 List of patients assigned to Nurse 2.
 * @return A list of patients who are assigned to either Nurse 1 or Nurse 2 but not both.
 *
 * Example:
 * nurse1 = listOf("John", "Adam", "Emma", "Kevin", "Julia")
 * nurse2 = listOf("Adam", "Emma", "Liam", "Sophia")
 * findUncommonPatients(nurse1, nurse2) // Output: ["John", "Kevin", "Julia", "Liam", "Sophia"]
 */
fun findUncommonPatients(nurse1: List<String>, nurse2: List<String>): List<String> {
/**
 * Given two lists of patients assigned to two different nurses, finds the uncommon patients
 * assigned to the two nurses, i.e., patients who are under the care of one nurse but not the other.
 *
 * @param nurse1 List of patients assigned to Nurse 1.
 * @param nurse2 List of patients assigned to Nurse 2.
 * @return A list of patients who are assigned to either Nurse 1 or Nurse 2 but not both.
 *
 * Example:
 * nurse1 = listOf("John", "Adam", "Emma", "Kevin", "Julia")
 * nurse2 = listOf("Adam", "Emma", "Liam", "Sophia")
 * findUncommonPatients(nurse1, nurse2) // Output: ["John", "Kevin", "Julia", "Liam", "Sophia"]
 */
fun findUncommonPatients(nurse1: List<String>, nurse2: List<String>): List<String> {

    val uncommonPatients = (nurse1.filter { it !in nurse2 } + nurse2.filter { it !in nurse1 }).distinct()
    return uncommonPatients
}