/**
 * Given two musicians, return a list of common notes between them.
 *
 * @param musician1 A list representing the notes of musician 1.
 * @param musician2 A list representing the notes of musician 2.
 * @return A list of common notes between musician 1 and musician 2.
 *
 * Example:
 * val musician1 = listOf('C', 'D', 'E', 'F', 'G')
 * val musician2 = listOf('A', 'B', 'C', 'D', 'E')
 * getCommonNotes(musician1, musician2) => ['C', 'D', 'E']
 */
fun getCommonNotes(musician1: List<Char>, musician2: List<Char>): List<Char> {

    val commonNotes = mutableListOf<Char>()

    // Iterate over the notes of musician 1
    for (note1 in musician1) {
        // Iterate over the notes of musician 2
        for (note2 in musician2) {
            // Check if the notes are the same
            if (note1 == note2) {
                commonNotes.add(note1)  // Add the common note to the list
            }
        }
    }

    return commonNotes
}
/**
 * Given two musicians, return a list of common notes between them.
 *
 * @param musician1 A list representing the notes of musician 1.
 * @param musician2 A list representing the notes of musician 2.
 * @return A list of common notes between musician 1 and musician 2.
 *
 * Example:
 * val musician1 = listOf('C', 'D', 'E', 'F', 'G')
 * val musician2 = listOf('A', 'B', 'C', 'D', 'E')
 * getCommonNotes(musician1, musician2) => ['C', 'D', 'E']
 */
fun getCommonNotes(musician1: List<Char>, musician2: List<Char>): List<Char> {
/**
 * Given two musicians, return a list of common notes between them.
 *
 * @param musician1 A list representing the notes of musician 1.
 * @param musician2 A list representing the notes of musician 2.
 * @return A list of common notes between musician 1 and musician 2.
 *
 * Example:
 * val musician1 = listOf('C', 'D', 'E', 'F', 'G')
 * val musician2 = listOf('A', 'B', 'C', 'D', 'E')
 * getCommonNotes(musician1, musician2) => ['C', 'D', 'E']
 */
fun getCommonNotes(musician1: List<Char>, musician2: List<Char>): List<Char> {

    val commonNotes = mutableListOf<Char>()

    // Iterate over the notes of musician 1
    for (note1 in musician1) {
        // Iterate over the notes of musician 2
        for (note2 in musician2) {
            // Check if the notes are the same
            if (note1 == note2) {
                commonNotes.add(note1)  // Add the common note to the list
            }
        }
    }

    return commonNotes
}