/**
 * This exercise aims to test your understanding of the 'continue statement' and the 'is operator'.
 * You are given two lists, patient1 and patient2, containing emotions expressed by two different individuals.
 * Your task is to find the common emotions between the two lists, ignoring any 'neutral' emotions and repeating emotions.
 * Implement the function below to solve this exercise.
 */
fun findCommonEmotions(patient1: List<String>, patient2: List<String>): List<String> {

    val commonEmotions = mutableListOf<String>()

    for (emotion1 in patient1) {
        for (emotion2 in patient2) {
            if (emotion1 == null || emotion2 == null) {
                continue
            } else if (emotion1 == emotion2 && emotion1 !in commonEmotions) {
                commonEmotions.add(emotion1)
            }
        }
    }

    return commonEmotions
}
/**
 * This exercise aims to test your understanding of the 'continue statement' and the 'is operator'.
 * You are given two lists, patient1 and patient2, containing emotions expressed by two different individuals.
 * Your task is to find the common emotions between the two lists, ignoring any 'neutral' emotions and repeating emotions.
 * Implement the function below to solve this exercise.
 */
fun findCommonEmotions(patient1: List<String>, patient2: List<String>): List<String> {
/**
 * This exercise aims to test your understanding of the 'continue statement' and the 'is operator'.
 * You are given two lists, patient1 and patient2, containing emotions expressed by two different individuals.
 * Your task is to find the common emotions between the two lists, ignoring any 'neutral' emotions and repeating emotions.
 * Implement the function below to solve this exercise.
 */
fun findCommonEmotions(patient1: List<String>, patient2: List<String>): List<String> {

    val commonEmotions = mutableListOf<String>()

    for (emotion1 in patient1) {
        for (emotion2 in patient2) {
            if (emotion1 == null || emotion2 == null) {
                continue
            } else if (emotion1 == emotion2 && emotion1 !in commonEmotions) {
                commonEmotions.add(emotion1)
            }
        }
    }

    return commonEmotions
}