/**
 * Given a photographer's name and a list of photo albums, return the total number
 * of photos taken by that photographer, by iterating over the albums.
 *
 * @param photographerName Name of the photographer.
 * @param photoAlbums List of photo albums, where each album is represented as a string.
 * @return Total number of photos taken by the photographer.
 */
fun getNumberOfPhotos(photographerName: String, photoAlbums: List<String>): Int {

    var totalPhotos = 0

    // Iterate over each photo album
    for (album in photoAlbums) {
        // Split album string into individual photo names
        val photos = album.split(',')

        // Iterate over each photo name
        for (photo in photos) {
            // Check if the photographer name exists in the photo name
            if (photographerName in photo) {
                // Extract the number of photos and add it to the total
                val numPhotos = photo.split('_')[1].toInt()
                totalPhotos += numPhotos
            }
        }
    }

    return totalPhotos
}
/**
 * Given a photographer's name and a list of photo albums, return the total number
 * of photos taken by that photographer, by iterating over the albums.
 *
 * @param photographerName Name of the photographer.
 * @param photoAlbums List of photo albums, where each album is represented as a string.
 * @return Total number of photos taken by the photographer.
 */
fun getNumberOfPhotos(photographerName: String, photoAlbums: List<String>): Int {
/**
 * Given a photographer's name and a list of photo albums, return the total number
 * of photos taken by that photographer, by iterating over the albums.
 *
 * @param photographerName Name of the photographer.
 * @param photoAlbums List of photo albums, where each album is represented as a string.
 * @return Total number of photos taken by the photographer.
 */
fun getNumberOfPhotos(photographerName: String, photoAlbums: List<String>): Int {

    var totalPhotos = 0

    // Iterate over each photo album
    for (album in photoAlbums) {
        // Split album string into individual photo names
        val photos = album.split(',')

        // Iterate over each photo name
        for (photo in photos) {
            // Check if the photographer name exists in the photo name
            if (photographerName in photo) {
                // Extract the number of photos and add it to the total
                val numPhotos = photo.split('_')[1].toInt()
                totalPhotos += numPhotos
            }
        }
    }

    return totalPhotos
}