/**
 * This function takes a list of nurses and a list of patients as input and returns a list of patients that are assigned to at least one nurse.
 *
 * @param nurses A list of nurses' names.
 * @param patients A list of patients' names.
 * @return A list of patients that are assigned to at least one nurse.
 *
 * Example:
 * nurses = listOf("Alice", "Bob", "Cameron")
 * patients = listOf("Adam", "Bob", "Claire", "Ethan", "Cameron")
 * findPatients(nurses, patients) // Output: ["Bob", "Cameron"]
 */
fun findPatients(nurses: List<String>, patients: List<String>): List<String> {

    val assignedPatients = mutableListOf<String>()

    for (patient in patients) {
        for (nurse in nurses) {
            if (patient == nurse) {
                assignedPatients.add(patient)
                break
            }
        }
    }

    return assignedPatients
}
/**
 * This function takes a list of nurses and a list of patients as input and returns a list of patients that are assigned to at least one nurse.
 *
 * @param nurses A list of nurses' names.
 * @param patients A list of patients' names.
 * @return A list of patients that are assigned to at least one nurse.
 *
 * Example:
 * nurses = listOf("Alice", "Bob", "Cameron")
 * patients = listOf("Adam", "Bob", "Claire", "Ethan", "Cameron")
 * findPatients(nurses, patients) // Output: ["Bob", "Cameron"]
 */
fun findPatients(nurses: List<String>, patients: List<String>): List<String> {
/**
 * This function takes a list of nurses and a list of patients as input and returns a list of patients that are assigned to at least one nurse.
 *
 * @param nurses A list of nurses' names.
 * @param patients A list of patients' names.
 * @return A list of patients that are assigned to at least one nurse.
 *
 * Example:
 * nurses = listOf("Alice", "Bob", "Cameron")
 * patients = listOf("Adam", "Bob", "Claire", "Ethan", "Cameron")
 * findPatients(nurses, patients) // Output: ["Bob", "Cameron"]
 */
fun findPatients(nurses: List<String>, patients: List<String>): List<String> {

    val assignedPatients = mutableListOf<String>()

    for (patient in patients) {
        for (nurse in nurses) {
            if (patient == nurse) {
                assignedPatients.add(patient)
                break
            }
        }
    }

    return assignedPatients
}