/**
 * Given a nested tuple, where each tuple represents an artist's album and contains the album name followed by a
 * list of tracks, write a function that returns the total count of tracks across all albums.
 *
 * @param artistAlbums A nested tuple containing album information for an artist. The tuple follows this format:
 *                     ((albumName1, [track1, track2, ...]), (albumName2, [track1, track2, ...]), ...)
 * @return The total count of tracks across all albums
 *
 * Example:
 * countAlbumTracks((("Album 1", listOf("Track 1", "Track 2")), ("Album 2", listOf("Track 1", "Track 2", "Track 3")))) -> 5
 */
fun countAlbumTracks(artistAlbums: List<Pair<String, List<String>>>): Int {

    var totalTracks = 0

    // Iterate over each album in the artistAlbums list
    for (album in artistAlbums) {
        val (_, tracks) = album

        // Iterate over each track in the album
        totalTracks += tracks.size
    }

    return totalTracks
}
/**
 * Given a nested tuple, where each tuple represents an artist's album and contains the album name followed by a
 * list of tracks, write a function that returns the total count of tracks across all albums.
 *
 * @param artistAlbums A nested tuple containing album information for an artist. The tuple follows this format:
 *                     ((albumName1, [track1, track2, ...]), (albumName2, [track1, track2, ...]), ...)
 * @return The total count of tracks across all albums
 *
 * Example:
 * countAlbumTracks((("Album 1", listOf("Track 1", "Track 2")), ("Album 2", listOf("Track 1", "Track 2", "Track 3")))) -> 5
 */
fun countAlbumTracks(artistAlbums: List<Pair<String, List<String>>>): Int {
/**
 * Given a nested tuple, where each tuple represents an artist's album and contains the album name followed by a
 * list of tracks, write a function that returns the total count of tracks across all albums.
 *
 * @param artistAlbums A nested tuple containing album information for an artist. The tuple follows this format:
 *                     ((albumName1, [track1, track2, ...]), (albumName2, [track1, track2, ...]), ...)
 * @return The total count of tracks across all albums
 *
 * Example:
 * countAlbumTracks((("Album 1", listOf("Track 1", "Track 2")), ("Album 2", listOf("Track 1", "Track 2", "Track 3")))) -> 5
 */
fun countAlbumTracks(artistAlbums: List<Pair<String, List<String>>>): Int {

    var totalTracks = 0

    // Iterate over each album in the artistAlbums list
    for (album in artistAlbums) {
        val (_, tracks) = album

        // Iterate over each track in the album
        totalTracks += tracks.size
    }

    return totalTracks
}