/**
 * Given two lists of artists and albums, find the number of artists that have albums in both lists.
 *
 * @param artists A list of artists.
 * @param albums A list of albums.
 * @return The number of artists with albums in both lists.
 *
 * Examples:
 * countIntersection(listOf("Artist A", "Artist B", "Artist C"), listOf("Album 1", "Album 2")) // 0
 * countIntersection(listOf("Artist D", "Artist E", "Artist F"), listOf("Album 1", "Album 2")) // 0
 * countIntersection(listOf("Artist G", "Artist H", "Artist I"), listOf("Album 2", "Album 3")) // 1
 * countIntersection(listOf("Artist J", "Artist K", "Artist L"), listOf("Album 3", "Album 4")) // 0
 */
fun countIntersection(artists: List<String>, albums: List<String>): Int {

    var count = 0
    for (artist in artists) {
        for (album in albums) {
            if (artist == album) {
                count++
            }
        }
    }
    return count
}
/**
 * Given two lists of artists and albums, find the number of artists that have albums in both lists.
 *
 * @param artists A list of artists.
 * @param albums A list of albums.
 * @return The number of artists with albums in both lists.
 *
 * Examples:
 * countIntersection(listOf("Artist A", "Artist B", "Artist C"), listOf("Album 1", "Album 2")) // 0
 * countIntersection(listOf("Artist D", "Artist E", "Artist F"), listOf("Album 1", "Album 2")) // 0
 * countIntersection(listOf("Artist G", "Artist H", "Artist I"), listOf("Album 2", "Album 3")) // 1
 * countIntersection(listOf("Artist J", "Artist K", "Artist L"), listOf("Album 3", "Album 4")) // 0
 */
fun countIntersection(artists: List<String>, albums: List<String>): Int {
/**
 * Given two lists of artists and albums, find the number of artists that have albums in both lists.
 *
 * @param artists A list of artists.
 * @param albums A list of albums.
 * @return The number of artists with albums in both lists.
 *
 * Examples:
 * countIntersection(listOf("Artist A", "Artist B", "Artist C"), listOf("Album 1", "Album 2")) // 0
 * countIntersection(listOf("Artist D", "Artist E", "Artist F"), listOf("Album 1", "Album 2")) // 0
 * countIntersection(listOf("Artist G", "Artist H", "Artist I"), listOf("Album 2", "Album 3")) // 1
 * countIntersection(listOf("Artist J", "Artist K", "Artist L"), listOf("Album 3", "Album 4")) // 0
 */
fun countIntersection(artists: List<String>, albums: List<String>): Int {

    var count = 0
    for (artist in artists) {
        for (album in albums) {
            if (artist == album) {
                count++
            }
        }
    }
    return count
}